結果
問題 |
No.647 明太子
|
ユーザー |
![]() |
提出日時 | 2019-12-09 02:40:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 46 ms / 4,500 ms |
コード長 | 822 bytes |
コンパイル時間 | 1,539 ms |
コンパイル使用メモリ | 162,092 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 08:45:22 |
合計ジャッジ時間 | 2,938 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; void chmax(int a, int b) { if (a >= b) { return; } else { a = b; return; } } //res = max(res,sol); int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); vector<int> b(n); rep(i, n) { cin >> a[i] >> b[i]; } int m; cin >> m; vector<int> x(m); vector<int> y(m); rep(i, m) { cin >> x[i] >> y[i]; } vector<int> miracle_mentaiko(m); int res = 0; rep(i, m) { rep(j, n) { if (a[j] >= x[i] && b[j] <= y[i]) miracle_mentaiko[i]++; } res = max(res, miracle_mentaiko[i]); } if (res == 0) { cout << 0 << endl; return 0; } rep(i, m) { if (miracle_mentaiko[i] == res) cout << i + 1 << endl; } return 0; }