結果
| 問題 | No.786 京都大学の過去問 |
| コンテスト | |
| ユーザー |
11111Ark
|
| 提出日時 | 2019-05-27 23:06:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 532 bytes |
| 記録 | |
| コンパイル時間 | 2,046 ms |
| コンパイル使用メモリ | 191,700 KB |
| 最終ジャッジ日時 | 2025-01-07 04:07:43 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvl vector<vector<ll>>
#define print(n) cout<<n<<endl
const int M=100010;
const int MOD=1000000007;
const int inf=1000000007;
const long long INF=1000000000000000007;
using ll=long long;
int main(){
int n;
cin>>n;
ll dp[100];
dp[0]=0,dp[1]=1,dp[2]=2;
rep(i,3,n+1)dp[i]=dp[i-1]+dp[i-2];
print(dp[n]);
}
11111Ark