結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
|
提出日時 | 2016-11-23 19:56:09 |
言語 | Scala(Beta) (3.6.2) |
結果 |
WA
|
実行時間 | - |
コード長 | 224 bytes |
コンパイル時間 | 9,786 ms |
コンパイル使用メモリ | 264,512 KB |
実行使用メモリ | 66,588 KB |
最終ジャッジ日時 | 2024-06-29 20:22:21 |
合計ジャッジ時間 | 42,148 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 10 RE * 10 TLE * 8 |
ソースコード
object Main { def gcd(n: Int, m: Int): Int = if (n % m == 0) m else gcd(m, n % m) def solve(n: String) = n.permutations.map(_.toInt).reduce(gcd) def main(args: Array[String]): Unit = solve(io.StdIn.readLine) }