結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
squid
|
| 提出日時 | 2018-02-09 22:41:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 930 bytes |
| コンパイル時間 | 1,235 ms |
| コンパイル使用メモリ | 161,424 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-26 07:49:55 |
| 合計ジャッジ時間 | 2,402 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 4 WA * 16 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
//constant
const long long int inf = 1<<30;
const int N = 1e4+1;
const int M = 1e3+1;
//variable
int cnt_ment[M];
int a[N],b[N];
int x[M],y[M];
//function
int main()
{
int n,m;
cin>>n;
for(int i=0; i<n; i++){
cin>>a[i]>>b[i];
}
cin>>m;
for(int i=0; i<m; i++){
cin>>x[i]>>y[i];
}
for(int i=0; i<N; i++){
for(int j=0; j<M; j++){
if(a[i]>=x[j]&&b[i]<=y[j]){
cnt_ment[j]++;
}
}
}
vector<int> ans;
int maxi=-1;
for(int i=0; i<m; i++){
maxi=max(maxi,cnt_ment[i]);
if(maxi==cnt_ment[i]){
ans.push_back(i);
}
}
if(maxi==0){
cout<<0<<endl;
return 0;
}
for(int i=0; i<ans.size(); i++){
cout<<ans[i]+1<<endl;
}
/*for(int i=0; i<m; i++){
cout<<cnt_ment[i]<<' ';
}*/
return 0;
}
squid