結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-02-11 19:36:07 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 4,500 ms |
| コード長 | 835 bytes |
| 記録 | |
| コンパイル時間 | 482 ms |
| コンパイル使用メモリ | 95,720 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-14 05:34:27 |
| 合計ジャッジ時間 | 1,449 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
using namespace std;
int main(){
long long N,M,A[10001],B[10001],x,y,num=0,count;
vector<long long> ans;
cin >> N;
for(int i=0;i<N;i++){
cin >> A[i] >> B[i];
}
cin >> M;
for(long long j=1;j<=M;j++){
count = 0;
cin >> x >> y;
for(int i=0;i<N;i++){
if(A[i]>=x&&B[i]<=y){
count++;
}
}
if(num==count&&count!=0){
ans.push_back(j);
}
else if(num < count){
num = count;
ans.clear();
ans.push_back(j);
}
}
if(ans.size()==0){
cout << 0;
}
for(int i=0;i<ans.size();i++){
cout << ans[i] << endl;
}
return 0;
}
focus