結果

問題 No.658 テトラナッチ数列 Hard
ユーザー BantakoBantako
提出日時 2018-05-28 12:16:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 1,624 ms
コンパイル使用メモリ 164,640 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 19:57:41
合計ジャッジ時間 2,375 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 18 ms
4,380 KB
testcase_05 AC 19 ms
4,376 KB
testcase_06 AC 19 ms
4,380 KB
testcase_07 AC 19 ms
4,376 KB
testcase_08 AC 20 ms
4,376 KB
testcase_09 AC 22 ms
4,376 KB
testcase_10 AC 22 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    8 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
const int K = 4912;
ll dp[K] = {0,0,0,1};
main(){
    for(int i = 4;i < K;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++){
        ll a;
        cin >> a;
        cout << dp[(a+K-1) % K] << endl;;
    }
    
}
0