結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
夕叢霧香(ゆうむらきりか)
|
| 提出日時 | 2018-02-09 22:26:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 676 bytes |
| コンパイル時間 | 727 ms |
| コンパイル使用メモリ | 79,176 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-26 07:35:35 |
| 合計ジャッジ時間 | 1,775 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 17 WA * 3 |
ソースコード
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)
int main(){
int n;
cin>>n;
vi a(n),b(n);
rep(i,n)cin>>a[i]>>b[i];
int m;
cin>>m;
vi x(m),y(m),c(m);
rep(i,m)cin>>x[i]>>y[i];
rep(i,n){
rep(j,m){
if(x[j]<=a[i]&&y[j]>=b[i])c[j]++;
}
}
vector<pii>t;
rep(i,m){
t.push_back(pii(-c[i],i+1));
}
sort(t.begin(),t.end());
int cnt=0;
rep(i,m){
if(i==0||t[i].first==t[i-1].first){
cout<<t[i].second<<endl;
cnt++;
}else{
break;
}
}
if(cnt==0)cout<<0<<endl;
}
夕叢霧香(ゆうむらきりか)