結果
問題 |
No.647 明太子
|
ユーザー |
|
提出日時 | 2020-07-12 17:25:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 943 bytes |
コンパイル時間 | 1,269 ms |
コンパイル使用メモリ | 115,888 KB |
最終ジャッジ日時 | 2025-01-11 20:03:18 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 18 WA * 2 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> using namespace std; typedef long long int ll; using ull = unsigned long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector<int> a(n),b(n); for(int i=0;i<n;i++) { cin >> a[i] >> b[i]; } int m; cin >> m; vector<pair<int,int>> v(m); for(int i=0;i<m;i++){ v[i].second=i+1; int x,y; cin >> x >> y; for(int j=0;j<n;j++){ if(a[j]>=x&&b[j]<=y)v[i].first++; } } sort(v.rbegin(), v.rend()); if(!v[0].first){ printf("0\n"); } else{ for(int i=0;i<m;i++){ if(v[i].first==v[0].first){ printf("%d\n",v[i].second); } } } }