結果

問題 No.658 テトラナッチ数列 Hard
ユーザー 💕💖💞💕💖💞
提出日時 2018-03-07 10:47:44
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 657 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 12,404 ms
コンパイル使用メモリ 432,020 KB
実行使用メモリ 75,944 KB
最終ジャッジ日時 2024-04-30 17:07:17
合計ジャッジ時間 19,547 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 392 ms
69,008 KB
testcase_01 AC 407 ms
69,172 KB
testcase_02 AC 382 ms
69,056 KB
testcase_03 AC 403 ms
69,088 KB
testcase_04 AC 645 ms
75,740 KB
testcase_05 AC 641 ms
75,884 KB
testcase_06 AC 622 ms
75,944 KB
testcase_07 AC 626 ms
74,364 KB
testcase_08 AC 633 ms
75,160 KB
testcase_09 AC 657 ms
75,888 KB
testcase_10 AC 629 ms
74,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {
  val n = readLine()!!.toInt()
  val base = mutableListOf( 0, 0, 0, 1 )
  for( i in (4..1000_000) ) {
    val next = (base[i-4] + base[i-3] + base[i-2] + base[i-1])%17
    base.add(next)
  }
  (1..n).map {
    // 4912のサイクルの周期性がある
    val t = ( (readLine()!!.toLong() -1L) % 4912).toInt()

    base[t]
  }.map { println(it) }
}
0