結果
問題 | No.647 明太子 |
ユーザー | hogeover30 |
提出日時 | 2018-02-09 22:28:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 36 ms / 4,500 ms |
コード長 | 473 bytes |
コンパイル時間 | 2,262 ms |
コンパイル使用メモリ | 194,300 KB |
最終ジャッジ日時 | 2025-01-05 08:11:29 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { 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<int> c(m); int maxc=0; for(int i=0; i<m; ++i) { int x, y; cin>>x>>y; for(int j=0; j<n; ++j) c[i]+=x<=a[j]&&y>=b[j]; maxc=max(maxc, c[i]); } if (maxc==0) cout<<0<<endl; else for(int i=0; i<m; ++i) if (c[i]==maxc) cout<<i+1<<endl; }