結果
問題 | No.314 ケンケンパ |
ユーザー |
|
提出日時 | 2016-11-20 15:10:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 1,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 623 ms |
コンパイル使用メモリ | 81,460 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-27 07:00:49 |
合計ジャッジ時間 | 1,270 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { int a=1,b=0,c=0,ap,bp,cp; int n; cin>>n; while(n--){ ap=a,bp=b,cp=c; a=(bp+cp)%1000000007; b=ap; c=bp; } cout<<((a+b)%1000000007+c)%1000000007<<endl; return 0; }