結果
| 問題 |
No.786 京都大学の過去問
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2019-02-08 21:32:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 639 bytes |
| コンパイル時間 | 879 ms |
| コンパイル使用メモリ | 94,120 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 18:30:39 |
| 合計ジャッジ時間 | 1,341 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 5 |
ソースコード
#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;
}
chocorusk