結果

問題 No.657 テトラナッチ数列 Easy
ユーザー fal_rndfal_rnd
提出日時 2018-04-25 10:17:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 72,984 KB
実行使用メモリ 64,988 KB
最終ジャッジ日時 2023-09-10 05:24:29
合計ジャッジ時間 6,883 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
59,780 KB
testcase_01 AC 133 ms
60,412 KB
testcase_02 AC 132 ms
60,084 KB
testcase_03 AC 133 ms
59,908 KB
testcase_04 AC 134 ms
60,036 KB
testcase_05 AC 309 ms
64,516 KB
testcase_06 AC 134 ms
59,952 KB
testcase_07 AC 133 ms
57,664 KB
testcase_08 AC 132 ms
60,152 KB
testcase_09 AC 321 ms
63,732 KB
testcase_10 AC 323 ms
64,612 KB
testcase_11 AC 323 ms
64,564 KB
testcase_12 AC 324 ms
64,808 KB
testcase_13 AC 331 ms
64,712 KB
testcase_14 AC 331 ms
64,740 KB
testcase_15 AC 328 ms
64,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.*;
class Main {
    static Scanner s=new Scanner(System.in);
    static int gInt(){return Integer.parseInt(s.next());}
    public static void main(String[]$){
        int[]a=new int[1000000];
        a[3]=1;
        for(int i=4;i<1000000;++i)
            a[i]=(a[i-1]+a[i-2]+a[i-3]+a[i-4])%17;
        for(int q=gInt();q>0;--q)
            System.out.println(a[gInt()-1]);
    }
}
0