結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
dnish
|
| 提出日時 | 2018-06-16 19:51:43 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 351µs | |
| コード長 | 542 bytes |
| 記録 | |
| コンパイル時間 | 918 ms |
| コンパイル使用メモリ | 180,460 KB |
| 実行使用メモリ | 9,912 KB |
| 最終ジャッジ日時 | 2026-10-11 08:01:51 |
| 合計ジャッジ時間 | 2,258 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include "bits/stdc++.h"
#define REP(i,n,N) for(ll i=(n); i<(N); i++)
#define RREP(i,n,N) for(ll i=(N-1); i>=n; i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define p(s) cout<<(s)<<endl
#define p2(a,b) cout<<(a)<<" "<<(b)<<endl
typedef long long ll;
using namespace std;
const ll inf=LONG_LONG_MAX;
ll N;
int main(){
while(cin>>N){
ll dp[55] = {};
dp[0]=1;
REP(i,0,N){
dp[i+1]+=dp[i];
dp[i+2]+=dp[i];
}
p(dp[N]);
}
return 0;
}
dnish