結果

問題 No.44 DPなすごろく
ユーザー sekiya9311sekiya9311
提出日時 2016-05-23 10:08:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,130 bytes
コンパイル時間 1,150 ms
コンパイル使用メモリ 103,344 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-16 08:53:45
合計ジャッジ時間 3,482 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 2 ms
6,940 KB
testcase_05 RE -
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 RE -
testcase_09 AC 2 ms
6,940 KB
testcase_10 RE -
testcase_11 AC 2 ms
6,940 KB
testcase_12 RE -
testcase_13 AC 2 ms
6,944 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 3 ms
6,940 KB
testcase_19 RE -
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>

#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define RREP(i,a) for(long (i)=(a)-1;(i)>=0;(i)--)
#define FORR(i,a,b) for(long (i)=(a)-1;(i)>=(b);(i)--)
#define MOD 1000000007
#define PI acos(-1.0)
#define DEBUG(C) cout<<C<<endl;
#define PII pair<int,int>
#define PLL pair<long,long>
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).begin(),(a).end(),greater<int>())

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

int main(){
	int N; cin>>N;
	LL cnt=0;
	vector<LL> dp(N+1,0);
	dp[0]=1;
	REP(i,N+1){
		dp[i+1]+=dp[i];
		dp[i+2]+=dp[i];
	}
	cout<<dp[N]<<endl;
}
0