結果
問題 | No.443 GCD of Permutation |
ユーザー |
![]() |
提出日時 | 2021-01-24 17:26:18 |
言語 | Crystal (1.14.0) |
結果 |
AC
|
実行時間 | 769 ms / 1,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 13,517 ms |
コンパイル使用メモリ | 297,976 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 07:50:21 |
合計ジャッジ時間 | 17,104 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
lib Cfun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64endclass Stringdef to_i64C.strtoll(self, nil, 10)endendrequire "big"s = read_linenum = s.to_big_is = s.chars.map &.to_in = s.sizeif s.count(s[0]) == nputs s.joinexitendg = 0s.each { |i|s.each { |j|g = g.gcd(9*(i - j)) if i > j}}p num.gcd(g)