結果

問題 No.647 明太子
ユーザー m1025o1184tm1025o1184t
提出日時 2019-12-09 02:37:27
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 836 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 167,300 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-01 21:58:01
合計ジャッジ時間 4,324 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;

void chmax(int a, int b) {
	if (a >= b) {
		return;
	}
	else {
		a = b;
		return;
	}
}

//res = max(res,sol);

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n; cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	rep(i, n) {
		cin >> a[i] >> b[i];
	}
	int m; cin >> m;
	vector<int> x(m);
	vector<int> y(m);
	rep(i, m) {
		cin >> x[i] >> y[i];
	}
	vector<int> miracle_mentaiko(m);
	int res = 0;
	rep(i, m) {
		rep(j, n) {
			if (a[j] >= x[i] && b[j] <= y[i]) miracle_mentaiko[i]++;
		}
		res = max(res, miracle_mentaiko[i]);
	}
	if (res == 0) {
		cout << 0 << endl;
		return 0;
	}
	rep(i, m) {
		if (miracle_mentaiko[i] == res) cout << i + 1 << ' ';
	}
	cout << endl;
	return 0;
}
0