結果
| 問題 | No.45 回転寿司 |
| ユーザー |
hiyori
|
| 提出日時 | 2016-04-01 02:42:39 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 497 ms |
| コンパイル使用メモリ | 58,584 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-24 11:23:09 |
| 合計ジャッジ時間 | 1,393 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 1 WA * 29 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N;
cin >> N;
vector<int> V(N);
for (int i = 0; i < N; i++) {
cin >> V[i];
}
int max = 0;
if (N == 1) max = V[0];
else {
for (int i = 0; i < N-1; i++) {
if (V[2*i] > V[2*i+1]) max += V[2*i];
else max += V[2*i+1];
}
}
cout << max << endl;
return 0;
}
hiyori