結果

問題 No.231 めぐるはめぐる (1)
ユーザー 37kt_37kt_
提出日時 2015-09-03 18:39:24
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 688 bytes
コンパイル時間 1,438 ms
コンパイル使用メモリ 154,160 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-26 02:34:07
合計ジャッジ時間 3,229 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int n;
int g[1000], d[1000];

int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++){
		scanf("%d %d", g + i, d + i);
	}
	
	vector<pair<int, int>> v;
	for (int i = 0; i < n; i++){
		v.push_back(make_pair(g[i] - 30000 * d[i], i));
	}
	sort(begin(v), end(v), greater<pair<int, int>>());
	
	vector<int> res;
	for (int i = 1; i <= min(6, n); i++){
		vector<int> r;
		int e = 0;
		for (int j = 0; j < 6; j++){
			int p = j % i;
			e += g[p] - 30000 * d[p];
			r.push_back(p);
		}
		if (e >= 3000000) res = r;
	}
	
	if (res.size() == 0) puts("NO");
	else {
		puts("YES");
		for (int i = 0; i < 6; i++){
			printf("%d\n", res[i] + 1);
		}
	}
}
0