結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
latte0119
|
| 提出日時 | 2015-10-31 22:43:31 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 631 bytes |
| 記録 | |
| コンパイル時間 | 533 ms |
| コンパイル使用メモリ | 67,080 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 06:38:22 |
| 合計ジャッジ時間 | 1,394 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include<cstdio>
#include<vector>
#include<algorithm>
#include<iostream>
#include<cassert>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<string>
using namespace std;
typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}
long long dp[100];
int main(){
int N;cin>>N;
dp[0]=1;
rep(i,N){
dp[i+1]+=dp[i];
dp[i+2]+=dp[i];
}
cout<<dp[N]<<endl;
return 0;
}
latte0119