結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
|
| 提出日時 | 2022-01-01 11:15:20 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 315 bytes |
| コンパイル時間 | 486 ms |
| コンパイル使用メモリ | 29,696 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 23:04:38 |
| 合計ジャッジ時間 | 1,537 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 1 WA * 29 |
ソースコード
#include <stdio.h>
int main(void) {
int n;
int a[1000];
int i, j, max = 0;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
for (i = 0; i < n - 2; i++) {
for (j = i + 2; j < n; j++)
if (max < a[i] + a[j])
max = a[i] + a[j];
}
printf("%d\n", max);
return 0;
}