結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
pin
|
| 提出日時 | 2016-12-26 12:20:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 308 bytes |
| コンパイル時間 | 1,088 ms |
| コンパイル使用メモリ | 54,000 KB |
| 実行使用メモリ | 16,840 KB |
| 最終ジャッジ日時 | 2024-12-14 23:43:19 |
| 合計ジャッジ時間 | 175,946 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 2 TLE * 28 |
ソースコード
#include <iostream>
using namespace std;
int N , v[1000] ;
int rec(int i){
int res ;
if(i>=N){
res = 0 ;
}else{
res = max(rec(i+2)+v[i],rec(i+1)) ;
}
return res ;
}
int main(void){
cin >> N ;
for(int i=0;i<N;i++) cin >> v[i] ;
cout << rec(0) ;
}
pin