結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-02-27 14:22:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 4,500 ms |
| コード長 | 586 bytes |
| コンパイル時間 | 1,524 ms |
| コンパイル使用メモリ | 170,304 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-13 15:54:58 |
| 合計ジャッジ時間 | 2,375 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include<bits/stdc++.h>
int main(){
int n;std::cin>>n;
std::vector<int>a(n),b(n);
for(int i=0;i<n;i++)std::cin>>a.at(i)>>b.at(i);
int m;std::cin>>m;
std::vector<int>c(m);
for(int i=0;i<m;i++){
int x,y;std::cin>>x>>y;
for(int j=0;j<n;j++){
c.at(i)+=x<=a.at(j)&&b.at(j)<=y;
}
}
int max=*std::max_element(c.begin(),c.end());
if(max==0){
std::cout<<0<<std::endl;
}else{
for(int i=0;i<m;i++){
if(c.at(i)==max){
std::cout<<i+1<<std::endl;
}
}
}
}
ngtkana