結果
| 問題 | No.443 GCD of Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-23 19:56:09 |
| 言語 | Scala(Beta) (3.8.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 224 bytes |
| 記録 | |
| コンパイル時間 | 6,171 ms |
| コンパイル使用メモリ | 272,012 KB |
| 実行使用メモリ | 66,188 KB |
| 最終ジャッジ日時 | 2026-03-09 14:54:57 |
| 合計ジャッジ時間 | 18,769 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 10 RE * 18 |
ソースコード
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)
}