結果
問題 |
No.231 めぐるはめぐる (1)
|
ユーザー |
![]() |
提出日時 | 2019-07-18 19:50:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 2,036 ms |
コンパイル使用メモリ | 166,024 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 22:39:46 |
合計ジャッジ時間 | 2,711 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:22:21: warning: 'idx' may be used uninitialized [-Wmaybe-uninitialized] 22 | cout << idx << endl; | ^~~ main.cpp:9:21: note: 'idx' was declared here 9 | int maxGD = -1, idx; | ^~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int maxGD = -1, idx; for (int i = 0; i < n; ++i) { int g, d; cin >> g >> d; if (g - 30000 * d > maxGD) { maxGD = g - 30000 * d; idx = i + 1; } } if (maxGD * 6 >= 30000 * 100) { cout << "YES" << endl; for (int i = 0; i < 6; ++i) { cout << idx << endl; } } else { cout << "NO" << endl; } return 0; }