結果

問題 No.647 明太子
ユーザー d_seid_sei
提出日時 2019-09-11 00:00:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 50 ms / 4,500 ms
コード長 932 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 86,512 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 13:18:31
合計ジャッジ時間 1,986 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 5 ms
4,376 KB
testcase_14 AC 39 ms
4,376 KB
testcase_15 AC 8 ms
4,376 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 47 ms
4,380 KB
testcase_18 AC 50 ms
4,380 KB
testcase_19 AC 10 ms
4,376 KB
testcase_20 AC 10 ms
4,380 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 AC 45 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
int main() {
	int N, M;
	cin >> N;
	vector<int>veca(N);
	vector<int>vecb(N);
	for (int ia = 0; ia < N; ia++) {
		cin >> veca.at(ia);
		cin >> vecb.at(ia);
	}
	cin >> M;
	vector<int>vecx(M);
	vector<int>vecy(M);
	for (int ib = 0; ib < M; ib++) {
		cin >> vecx.at(ib);
		cin >> vecy.at(ib);
	}
	vector<int>vecc(M);
	for (int ic = 0; ic < M; ic++) {
		for (int id = 0; id < N; id++) {
			if (vecx.at(ic) <= veca.at(id) && vecy.at(ic) >= vecb.at(id)) {
				vecc.at(ic)++;
			}
		}
	}
	vector<int>vecd(M);
	for (int ie = 0; ie < M; ie++) {
		vecd.at(ie) = vecc.at(ie);
	}
	sort(vecd.begin(), vecd.end());
	int F = vecd.at(M - 1);
	if (F) {
		for (int ig = 0; ig < M; ig++) {
			if (vecc.at(ig) == F) {
				cout << ig + 1 << endl;
			}
		}
	}
	else {
		cout << 0 << endl;
	}
}



	
0