結果
| 問題 | No.45 回転寿司 |
| ユーザー |
E. Gordon
|
| 提出日時 | 2019-04-07 18:59:38 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 331 bytes |
| 記録 | |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 73,472 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2026-03-15 13:45:53 |
| 合計ジャッジ時間 | 175,870 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 2 TLE * 28 |
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
int ssh(int *d, int n)
{
if(n < 0) return 0;
return max(ssh(d, n-2) + d[n], ssh(d, n-1));
}
int main()
{
int n, v[1000] = {0};
cin >> n;
for(int i = 0; i < n; i++){
scanf("%d", &v[i]);
}
cout << ssh(v, n-1) << endl;
return 0;
}
E. Gordon