結果
問題 |
No.1237 EXP Multiple!
|
ユーザー |
|
提出日時 | 2021-02-10 18:43:39 |
言語 | Kotlin (2.1.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 13,089 ms |
コンパイル使用メモリ | 435,124 KB |
実行使用メモリ | 81,352 KB |
最終ジャッジ日時 | 2024-07-08 05:25:15 |
合計ジャッジ時間 | 23,666 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 14 WA * 1 RE * 4 |
コンパイルメッセージ
Main.kt:3:9: warning: variable 'n' is never used val n = readLine()!!.toInt() ^
ソースコード
fun main() { val n = readLine()!!.toInt() val a = readLine()!!.split(" ").map { it.toLong() } if (a.any { it >= 4 }) { println(1_000_000_007) return } var pi = 1L for (ai in a) { val k = (1..ai).fold(1) { acc, x -> (acc * x).toInt() } for (i in 0 until k) pi *= ai if (pi > 1_000_000_007) { println(1_000_000_007) return } } println(1_000_000_007 % pi) }