結果

問題 No.1081 和の和
ユーザー face4face4
提出日時 2021-04-11 15:12:54
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 212 bytes
コンパイル時間 13,938 ms
コンパイル使用メモリ 413,452 KB
実行使用メモリ 53,364 KB
最終ジャッジ日時 2023-09-09 17:35:23
合計ジャッジ時間 17,739 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 294 ms
52,836 KB
testcase_01 AC 292 ms
52,816 KB
testcase_02 AC 290 ms
52,768 KB
testcase_03 AC 295 ms
52,940 KB
testcase_04 AC 304 ms
52,972 KB
testcase_05 AC 291 ms
53,192 KB
testcase_06 AC 303 ms
53,236 KB
testcase_07 AC 308 ms
52,796 KB
testcase_08 AC 311 ms
52,952 KB
testcase_09 AC 302 ms
53,364 KB
testcase_10 AC 301 ms
53,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const val mod = 1000000007
fun main() {
    val n = readLine()!!.toInt()
    var a = readLine()!!.split(" ").map{it.toInt()}
    repeat(n-1){
        a = a.zipWithNext{a, b -> (a+b)%mod}
    }
    println(a[0])
}
0