結果

問題 No.231 めぐるはめぐる (1)
ユーザー square1001
提出日時 2016-10-29 17:36:54
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 1,525 ms
コンパイル使用メモリ 166,764 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 18:04:48
合計ジャッジ時間 2,212 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int n, a[1009], b[1009];
int main() {
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i] >> b[i];
	int res = -1, pos = -1;
	for(int i = 0; i < n; i++) {
		if(a[i] - 30000 * b[i] > res) {
			res = a[i] - 30000 * b[i];
			pos = i;
		}
	}
	if(res * 6 >= 3000000) {
		cout << "YES" << endl;
		for(int i = 0; i < 6; i++) cout << pos + 1 << endl;
	}
	else cout << "NO" << endl;
	return 0;
}
0