結果
問題 |
No.647 明太子
|
ユーザー |
|
提出日時 | 2019-02-27 10:48:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 46 ms / 4,500 ms |
コード長 | 607 bytes |
コンパイル時間 | 1,819 ms |
コンパイル使用メモリ | 168,780 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 05:03:01 |
合計ジャッジ時間 | 2,754 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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> ans(m); for(int i=0; i<m; i++){ int x, y; cin >> x >> y; for(int j=0; j<n; j++){ if(a[j] >= x && b[j] <= y) ans[i]++; } } int max_n = *max_element(ans.begin(), ans.end()); if(max_n == 0){ cout << 0 << endl; return 0; } for(int i=0; i<m; i++){ if(ans[i] == max_n) cout << i+1 << endl; } return 0; }