結果
問題 | No.647 明太子 |
ユーザー |
|
提出日時 | 2020-06-30 02:05:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 48 ms / 4,500 ms |
コード長 | 501 bytes |
コンパイル時間 | 3,012 ms |
コンパイル使用メモリ | 196,736 KB |
最終ジャッジ日時 | 2025-01-11 13:37:25 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ cin.tie(0),ios::sync_with_stdio(false); int n; cin>>n; vector<pair<int,int>>ab(n); for(auto&&i:ab)cin>>i.first>>i.second; int m; cin>>m; vector<int>xy(m,0); for(int i=0;i<m;++i){ int x,y; cin>>x>>y; for(auto&&j:ab){ if(x>j.first||y<j.second)continue; ++xy.at(i); } } int mx=*max_element(xy.begin(),xy.end()); if(mx!=0){ for(int i=0;i<m;++i){ if(xy.at(i)==mx){ cout<<i+1<<"\n"s; } } } else cout<<0<<"\n"s; }