結果

問題 No.647 明太子
ユーザー Shawn stayCShawn stayC
提出日時 2020-07-13 23:14:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 45 ms / 4,500 ms
コード長 747 bytes
コンパイル時間 1,906 ms
コンパイル使用メモリ 173,172 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-26 05:21:56
合計ジャッジ時間 3,555 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
#define rall(x) (x).rbegin(),(x).rend()

int main(){
	int n; cin>>n;
	vector<pair<int,int>> vpn(n);
	rep(i,n){
		int a,b; cin>>a>>b;
		vpn[i].first=a; vpn[i].second=b;
	}
	int m; cin>>m;
	vector<pair<int,int>> vpm(m);
	rep(i,m){
		int x,y; cin>>x>>y;
		vpm[i].first=x; vpm[i].second=y;
	}
	vector<pair<int,int>> vpa(m);
	rep(i,m){
		rep(j,n){
			vpa[i].second=(i+1)*-1;
			if(vpm[i].first<=vpn[j].first&&vpm[i].second>=vpn[j].second){
				vpa[i].first++;
			}
		}
	}
	sort(rall(vpa));
	for(int i=0; i<m; i++){
		if(vpa[0].first==0) {cout<<0<<endl; return 0;}
		cout<<-vpa[i].second<<endl;
		if(vpa[i+1].first<vpa[i].first) return 0;
	}
}
0