結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
Pumpkin1e18
|
| 提出日時 | 2018-05-12 23:44:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 894 bytes |
| コンパイル時間 | 1,503 ms |
| コンパイル使用メモリ | 159,364 KB |
| 実行使用メモリ | 11,672 KB |
| 最終ジャッジ日時 | 2024-06-28 09:45:32 |
| 合計ジャッジ時間 | 2,471 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
27 | scanf("%lld", &n);
| ~~~~~^~~~~~~~~~~~
main.cpp:28:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
28 | rep(i,n)scanf("%lld", &a[i]);
| ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
int mod = 1e9+7;
int a[100000], dp[1000010];
signed main(){
int n;
scanf("%lld", &n);
rep(i,n)scanf("%lld", &a[i]);
dp[4] = 1;
repi(i,5,1000000+1){
dp[i] = dp[i-1]+dp[i-2]+dp[i-3]+dp[i-4];
dp[i] %= 17;
}
rep(i,n)printf("%lld\n", dp[a[i]]);
return 0;
}
Pumpkin1e18