結果
問題 |
No.647 明太子
|
ユーザー |
👑 |
提出日時 | 2020-01-27 23:54:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 906 bytes |
コンパイル時間 | 1,089 ms |
コンパイル使用メモリ | 80,704 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 16:35:21 |
合計ジャッジ時間 | 2,388 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 17 WA * 3 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef pair<int,int> P; int main(){ int n;cin>>n; vector<P> p(n); for(int i = 0; n > i; i++){ cin>>p[i].first >> p[i].second; } int m;cin>>m; vector<P> f(m); vector<P> A(m); for(int i = 0; m > i; i++){ cin>>f[i].first >> f[i].second; A[i].first = 0; A[i].second = i+1; } for(int i = 0; m > i; i++){ for(int j = 0; n > j; j++){ if(p[j].first >= f[i].first && p[j].second <= f[i].second){ A[i].first++; } } } sort(A.begin(),A.end(),greater<P>()); vector<int> Ans; for(int i = 0; A[0].first==A[i].first; i++){ Ans.push_back(A[i].second); } sort(Ans.begin(),Ans.end()); for(int i = 0; Ans.size() > i; i++){ cout << Ans[i] << endl; } }