結果
| 問題 |
No.44 DPなすごろく
|
| ユーザー |
IL_msta
|
| 提出日時 | 2015-06-15 20:47:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 682 bytes |
| コンパイル時間 | 640 ms |
| コンパイル使用メモリ | 83,220 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 21:01:25 |
| 合計ジャッジ時間 | 1,211 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <list>
#include <queue>
#include <vector>
#include <complex>
/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) std::cout<<(p)<<std::endl;
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////
LL dp[53];
int main(void){
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::cout << std::fixed;//
//cout << setprecision(6);//
int N;
cin>>N;
dp[0] = 1;
rep(i,N+1){
dp[i+1] += dp[i];
dp[i+2] += dp[i];
}
P(dp[N]);
return 0;
}
IL_msta