結果

問題 No.647 明太子
ユーザー ryoissyryoissy
提出日時 2018-02-09 22:26:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 35 ms / 4,500 ms
コード長 705 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 145,504 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-09 09:20:59
合計ジャッジ時間 2,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 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,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 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,380 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 AC 25 ms
4,376 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 33 ms
4,376 KB
testcase_18 AC 35 ms
4,380 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 AC 20 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n,m;
int a[10005],b[10005];
int x[1005],y[1005];
int cnt[1005];

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d",&a[i],&b[i]);
	}
	scanf("%d",&m);
	for(int i=0;i<m;i++){
		scanf("%d%d",&x[i],&y[i]);
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(x[j]<=a[i] && y[j]>=b[i])cnt[j]++;
		}
	}
	int be=0;
	for(int i=0;i<m;i++){
		be=max(be,cnt[i]);
	}
	vector<int> ans;
	for(int i=0;i<m;i++){
		if(be==cnt[i]){
			ans.push_back(i+1);
		}
	}
	if(be==0){
		printf("0\n");
	}else{
		for(int i=0;i<ans.size();i++){
			printf("%d\n",ans[i]);
		}
	}
	return 0;
}
0