結果

問題 No.647 明太子
ユーザー autumn-eelautumn-eel
提出日時 2018-02-18 20:54:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 38 ms / 4,500 ms
コード長 607 bytes
コンパイル時間 1,426 ms
コンパイル使用メモリ 166,768 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 09:35:00
合計ジャッジ時間 2,576 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 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 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 29 ms
4,380 KB
testcase_15 AC 6 ms
4,376 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 36 ms
4,380 KB
testcase_18 AC 38 ms
4,376 KB
testcase_19 AC 5 ms
4,380 KB
testcase_20 AC 5 ms
4,376 KB
testcase_21 AC 3 ms
4,380 KB
testcase_22 AC 17 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int a[20000],b[20000];
signed main(){
	int n;scanf("%d",&n);
	rep(i,n)scanf("%d%d",&a[i],&b[i]);
	vector<int>v;
	int Max=0;
	int m;scanf("%d",&m);
	rep(i,m){
		int x,y;scanf("%d%d",&x,&y);
		int cnt=0;
		rep(j,n){
			if(x<=a[j]&&y>=b[j])cnt++;
		}
		if(Max<cnt)v.clear(),Max=cnt;
		if(Max==cnt)v.push_back(i+1);
	}
	if(Max==0)puts("0");
	else{
		for(int i:v)cout<<i<<endl;
	}
}
0