結果

問題 No.933 おまわりさんこいつです
ユーザー rutilicusrutilicus
提出日時 2021-02-13 21:55:23
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 14,292 ms
コンパイル使用メモリ 415,088 KB
実行使用メモリ 64,708 KB
最終ジャッジ日時 2023-09-28 07:32:15
合計ジャッジ時間 25,509 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 289 ms
53,156 KB
testcase_01 AC 292 ms
53,076 KB
testcase_02 AC 290 ms
52,896 KB
testcase_03 AC 289 ms
53,016 KB
testcase_04 AC 288 ms
52,996 KB
testcase_05 AC 294 ms
52,952 KB
testcase_06 AC 293 ms
53,500 KB
testcase_07 AC 301 ms
53,108 KB
testcase_08 AC 300 ms
53,080 KB
testcase_09 AC 295 ms
53,012 KB
testcase_10 AC 299 ms
53,152 KB
testcase_11 AC 303 ms
53,236 KB
testcase_12 AC 306 ms
53,468 KB
testcase_13 AC 340 ms
53,192 KB
testcase_14 AC 353 ms
53,584 KB
testcase_15 AC 390 ms
53,260 KB
testcase_16 AC 458 ms
57,996 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 467 ms
57,736 KB
testcase_21 AC 292 ms
52,956 KB
testcase_22 AC 294 ms
53,044 KB
testcase_23 AC 575 ms
64,708 KB
testcase_24 AC 571 ms
64,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    readInputLine()
    val pArr = readInputLine().split(" ").map { root(it.toLong()) }.toLongArray()

    builder.appendLine(pArr.fold(1L) { acc, l -> root(acc * l)})

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}

fun root(a: Long): Long {
    return if (a % 9L != 0L) a % 9L else 9L
}
0