結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
cww
|
| 提出日時 | 2017-09-18 15:13:48 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 379µs | |
| コード長 | 640 bytes |
| 記録 | |
| コンパイル時間 | 1,034 ms |
| コンパイル使用メモリ | 214,356 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-11 07:54:44 |
| 合計ジャッジ時間 | 2,369 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define SORT(x) sort((x).begin(),(x).end(),greater<int>())
using LL=long long;
using ULL=unsigned long long;
using PII=pair<int,int>;
const LL INF = numeric_limits<LL>::max();
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
int N;
cin >> N;
vector<LL> dp( 50 + 1 );
dp[ 0 ] = 1;
dp[ 1 ] = 1;
for( int i = 2; i <= N; i++ )
{
dp[ i ] = dp[ i - 1 ] + dp[ i - 2 ];
}
cout << dp[ N ] << endl;
return 0;
}
cww