結果

問題 No.231 めぐるはめぐる (1)
ユーザー umaumaxumaumax
提出日時 2017-05-02 21:09:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 513 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 60,752 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 05:17:17
合計ジャッジ時間 1,777 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,356 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>

using namespace std;

int main(int argc, const char* argv[])
{
	int N;
	cin >> N;
	int G[N], D[N];
	int EXP[N];
	for (int i = 0; i < N; i++) {
		cin >> G[i];
		cin >> D[i];
		EXP[i] = G[i] - 30000 * D[i];
	}
	auto maxExpp	= max_element(EXP, &EXP[N]);
	size_t maxIndex = distance(EXP, maxExpp);
	bool ret		= 3000000 <= *maxExpp * 6;
	cout << (ret ? "YES" : "NO") << endl;
	if (!ret) return 0;
	for (int i = 0; i < 6; i++) {
		cout << maxIndex + 1 << endl;
	}
	return 0;
}
0