結果

問題 No.647 明太子
ユーザー cidercider
提出日時 2018-02-13 11:13:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 40 ms / 4,500 ms
コード長 1,496 bytes
コンパイル時間 1,352 ms
コンパイル使用メモリ 85,284 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 09:33:14
合計ジャッジ時間 2,602 ms
ジャッジサーバーID
(参考情報)
judge11 / 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 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 3 ms
4,380 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 32 ms
4,376 KB
testcase_15 AC 7 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 38 ms
4,380 KB
testcase_18 AC 40 ms
4,376 KB
testcase_19 AC 10 ms
4,380 KB
testcase_20 AC 9 ms
4,376 KB
testcase_21 AC 4 ms
4,376 KB
testcase_22 AC 30 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<fstream>
#include<utility>
#include<bitset>
#include<map>
#include<deque>
#include<cmath>
#define FOR(i, a, b) for (i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define For(i, N) for (i = 0; i < N; ++i)
#define rev(N) 	for (int i = N - 1; i >= 0; --i)
#define all(v) v.begin(), v.end()
#define make(N) int N; cin >> N;
#define mod 1000000007
#define re return 0

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;

template<typename T>
void say(T s) {
	cout << s << endl;
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << endl;
}

bool comp(pii x, pii y) {
	if (x.first != y.first)return x.first > y.first;
	else return x.second < y.second;
}

int main() {
	make(N);
	vi A(N), B(N);
	rep(N) cin >> A[i] >> B[i];
	make(M);
	vector<pii> point;
	rep(M)point.push_back({ 0,i + 1 });
	int p;
	For(p, M) {
		make(X);
		make(Y);
		rep(N)
			if (X <= A[i] && B[i] <= Y)++point[p].first;
	}
	sort(all(point), comp);
	if (point[0].first == 0) say(0);
	else {
		int Max = point[0].first;
		int i = 0;
		while (point[i].first == Max)say(point[i++].second);
	}
}
0