結果
| 問題 | No.231 めぐるはめぐる (1) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-12-30 04:47:05 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 452 bytes | 
| コンパイル時間 | 1,608 ms | 
| コンパイル使用メモリ | 166,164 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-04 18:04:22 | 
| 合計ジャッジ時間 | 2,105 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 11 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:21:33: warning: 'idx' may be used uninitialized [-Wmaybe-uninitialized]
   21 |                         cout << idx << endl;
      |                                 ^~~
main.cpp:9:20: note: 'idx' was declared here
    9 |         int a = 0, idx;
      |                    ^~~
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); 
	int n;
	cin >> n;
	int a = 0, idx;
	for(int i = 1; i <= n; i++) {
		int g, d;
		cin >> g >> d;
		if(g - d * 30000 > a) {
			idx = i;
			a = g - d * 30000;
		}
	}
	if(a * 6 >= 3000000) {
		cout << "YES" << endl;
		for(int i = 0; i < 6; i++) {
			cout << idx << endl;
		}
	} else {
		cout << "NO" << endl;
	}
	return 0;
}
            
            
            
        