結果

問題 No.786 京都大学の過去問
ユーザー chocoruskchocorusk
提出日時 2019-02-08 21:32:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 92,160 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-11 03:59:07
合計ジャッジ時間 1,405 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n; cin>>n;
	ll dp[2][51]={};
	dp[0][0]=dp[1][1]=1;
	for(int i=1; i<n; i++){
		for(int j=0; j<2; j++){
			dp[j][i]+=dp[j^1][i-1];
			if(j==0){
				dp[j][i]+=dp[j][i-1];
			}
		}
	}
	cout<<dp[0][n-1]+dp[1][n-1]<<endl;
	return 0;
}
0