結果
問題 |
No.314 ケンケンパ
|
ユーザー |
|
提出日時 | 2018-01-31 20:31:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 1,000 ms |
コード長 | 322 bytes |
コンパイル時間 | 322 ms |
コンパイル使用メモリ | 39,296 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-29 23:51:44 |
合計ジャッジ時間 | 1,118 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <stdio.h> #include <string.h> #include <math.h> using namespace std; typedef unsigned long long ull; int N; int main(void){ scanf("%d", &N); ull ans[N]; ans[0] = 1; ans[1] = 2; ans[2] = 2; for(int i = 3;i < N;++i){ ans[i] = (ans[i-2] + ans[i-3]) % (ull) (1e9 + 7); } printf("%llu\n", ans[N-1]); }