結果
| 問題 |
No.44 DPなすごろく
|
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-19 21:51:56 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 790 bytes |
| コンパイル時間 | 3,217 ms |
| コンパイル使用メモリ | 275,068 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-11-19 21:52:01 |
| 合計ジャッジ時間 | 4,205 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
using i128 = __int128;
void solve(){
i64 n;cin>>n;
i64 a[60]={0};
a[0]=1;a[1]=1;
for(int i=2;i<=n;++i){
a[i]=a[i-1]+a[i-2];
}
cout<<a[n];
return;
}
int main(){
ios::sync_with_stdio(false);cin.tie(nullptr);
solve();
return 0;
}
/*
***** Orz Kiropo *******
*?????????+ +
*?????????? + +
*??????????
*?????????? ++ + + +
* ?????????+
* ????????? +
*??????????
*?????????? + +
*??????????
*???????? + + + +Code is far away from ?
*???????? + bug with the animal protecting
*????? ? ????? ????,???bug?
*???? ?????? ??
*?? ? ????? ???
*? ????????? + + + +
*???????????
*???????????+ + + +
*/
vjudge1