結果

問題 No.658 テトラナッチ数列 Hard
ユーザー 💕💖💞💕💖💞
提出日時 2018-03-07 10:43:19
言語 Kotlin
(1.9.23)
結果
RE  
実行時間 -
コード長 372 bytes
コンパイル時間 10,226 ms
コンパイル使用メモリ 431,812 KB
実行使用メモリ 58,952 KB
最終ジャッジ日時 2024-04-30 17:05:27
合計ジャッジ時間 14,962 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 280 ms
56,768 KB
testcase_01 AC 276 ms
56,572 KB
testcase_02 AC 287 ms
56,780 KB
testcase_03 AC 304 ms
56,900 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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..4_912) ) {
    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() % 4912).toInt()
    base[t-1]
  }.map { println(it) }
}
0