結果

問題 No.231 めぐるはめぐる (1)
ユーザー d_seid_sei
提出日時 2019-10-23 20:49:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,441 bytes
コンパイル時間 2,232 ms
コンパイル使用メモリ 103,716 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 09:22:33
合計ジャッジ時間 2,186 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
#define lint long long int
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
*/

int main() {
	int N;
	cin >> N;
	vector<int>vecg(N);
	vector<int>vecd(N);
	vector<int>vecgd(2 * N);
	for (int ia = 0; ia < 2*N; ia++) {
		cin >> vecgd.at(ia);
	}
	for (int ib = 0; ib < N; ib++) {
		vecg.at(ib) = vecgd.at(2 * ib);
		vecd.at(ib) = vecgd.at(2 * ib + 1);
	}
	vector<int>vecs(N);
	for (int ic = 0; ic < N; ic++) {
		vecs.at(ic) = vecg.at(ic) - vecd.at(ic) * 30000;
	}
	vector<int>vecss(N);
	for (int ig = 0; ig < N; ig++) {
		vecss.at(ig) = vecs.at(ig);
	}
	sort(vecs.rbegin(), vecs.rend());
	int max = vecs.at(0);
	int ID = 0;
	for (int id = 0; id < N; id++) {
		if (vecss.at(id) == max) {
			ID = id;
			break;
		}
	}
	if (max * 6 >= 3000000) {
		cout << "YES" << endl;
		for (int ie = 0; ie < 6; ie++) {
			cout << ID +1<< endl;
		}
	}
	else {
		cout << "NO" << endl;
	}
}

0