結果

問題 No.1237 EXP Multiple!
ユーザー 👑 zeronosu77108zeronosu77108
提出日時 2021-02-10 18:43:39
言語 Kotlin
(1.9.23)
結果
RE  
実行時間 -
コード長 462 bytes
コンパイル時間 14,984 ms
コンパイル使用メモリ 423,180 KB
実行使用メモリ 70,924 KB
最終ジャッジ日時 2023-09-22 13:45:40
合計ジャッジ時間 25,924 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
53,088 KB
testcase_01 AC 574 ms
70,572 KB
testcase_02 AC 597 ms
70,664 KB
testcase_03 AC 594 ms
70,924 KB
testcase_04 AC 596 ms
70,696 KB
testcase_05 RE -
testcase_06 AC 520 ms
66,192 KB
testcase_07 RE -
testcase_08 AC 569 ms
68,352 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 515 ms
66,376 KB
testcase_12 AC 511 ms
66,256 KB
testcase_13 AC 526 ms
66,372 KB
testcase_14 AC 532 ms
66,244 KB
testcase_15 AC 524 ms
66,312 KB
testcase_16 AC 524 ms
66,372 KB
testcase_17 AC 525 ms
66,280 KB
testcase_18 AC 523 ms
66,236 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:9: warning: variable 'n' is never used
    val n = readLine()!!.toInt()
        ^

ソースコード

diff #

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)
}
0