結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-27 02:18:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 4,500 ms |
| コード長 | 652 bytes |
| コンパイル時間 | 2,106 ms |
| コンパイル使用メモリ | 198,120 KB |
| 最終ジャッジ日時 | 2025-02-07 16:46:08 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N; cin >> N;
vector<pair<int,int>> A(N);
for(auto &[x, y] : A) cin >> x >> y;
int M; cin >> M;
vector<pair<int,int>> B(M);
for(auto &[x, y] : B) cin >> x >> y;
vector<int> cnt(M, 0);
rep(i,M)rep(j,N)cnt[i] += B[i].first <= A[j].first && B[i].second >= A[j].second;
int ma = *max_element(cnt.begin(), cnt.end());
if(ma == 0) {
cout << 0 << endl;
} else {
rep(i,M) if(ma == cnt[i]) cout << i + 1 << '\n';
}
}