Submission #00090
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <bits/stdc++.h> using namespace std; int main() { while (1) { int n; cin >> n; if (n == 0) { return (0); } int a[n]; int Min = INT_MAX; int ans = -1; for ( int i = 0; i < n; i++) { cin >> a[i]; if ( abs (2023 - a[i]) < Min) { Min = abs (2023 - a[i]); ans = i; } } cout << ans + 1 << "\n" ; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0006 - スポンサー賞はどのチーム? |
ユーザー名 | woody_1227 |
投稿日時 | 2024-03-29 12:13:28 |
言語 | C++17 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 503 Byte |
最大実行時間 | 40 ms |
最大メモリ使用量 | 648 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 40 ms | 604 KB |
1
|
A2 | AC | 28 ms | 448 KB |
1
|
A3 | AC | 31 ms | 544 KB |
1
|
A4 | AC | 29 ms | 648 KB |
1
|