結果
| 問題 | No.45 回転寿司 |
| ユーザー |
compass19
|
| 提出日時 | 2017-01-11 23:11:35 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 25,012 KB |
| 最終ジャッジ日時 | 2026-02-24 00:05:57 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:4:9: error: C++ style comments are not allowed in ISO C90
4 | // データ読み込み
| ^
main.c:4:9: note: (this will be reported only once per input file)
ソースコード
#include<stdio.h>
#define max(a, b) (a > b)?a:b
int main(){
// データ読み込み
int n;
scanf("%d", &n);
int v[n];
int i;
for (i = 0; i < n; i++) scanf("%d", &v[i]);
// main
int p = 0;
int q = 0;
int tmp_p;
for (i = 0; i < n; i++)
{
tmp_p = p;
p = v[i] + q;
q = max(tmp_p, q);
}
printf("%d\n", max(p, q));
}
compass19