結果

問題 No.657 テトラナッチ数列 Easy
ユーザー BantakoBantako
提出日時 2018-05-28 11:44:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 1,483 ms
コンパイル使用メモリ 164,152 KB
実行使用メモリ 7,448 KB
最終ジャッジ日時 2023-09-12 19:57:38
合計ジャッジ時間 2,942 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
7,376 KB
testcase_01 AC 9 ms
7,440 KB
testcase_02 AC 9 ms
7,236 KB
testcase_03 AC 8 ms
7,256 KB
testcase_04 AC 8 ms
7,220 KB
testcase_05 AC 21 ms
7,236 KB
testcase_06 AC 9 ms
7,380 KB
testcase_07 AC 8 ms
7,236 KB
testcase_08 AC 9 ms
7,384 KB
testcase_09 AC 24 ms
7,236 KB
testcase_10 AC 23 ms
7,448 KB
testcase_11 AC 24 ms
7,240 KB
testcase_12 AC 25 ms
7,312 KB
testcase_13 AC 25 ms
7,300 KB
testcase_14 AC 26 ms
7,380 KB
testcase_15 AC 26 ms
7,224 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;    
int dp[1000000] = {0,0,0,1};
main(){
    for(int i = 4;i < 1000000;i++){
        dp[i] = (dp[i-4] + dp[i-3] + dp[i-2] + dp[i-1]) % 17;
    }
    int N;
    cin >> N;
    for(int i = 0;i < N;i++){
        int a;
        cin >> a;
        cout << dp[a-1] << endl;;
    }
}
0