結果
問題 | No.647 明太子 |
ユーザー |
![]() |
提出日時 | 2024-09-16 00:10:01 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 41 ms / 4,500 ms |
コード長 | 714 bytes |
コンパイル時間 | 3,003 ms |
コンパイル使用メモリ | 247,924 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 00:10:05 |
合計ジャッジ時間 | 4,347 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef LOCAL#include "settings/debug.cpp"#else#define Debug(...) void(0)#endif#define rep(i, n) for (int i = 0; i < (n); ++i)using ll = long long;using ull = unsigned long long;int main() {int n;cin >> n;vector<pair<int, int>> v(n);rep(i, n) cin >> v[i].first >> v[i].second;int m;cin >> m;vector<int> cnt(m, 0);rep(i, m) {int x, y;cin >> x >> y;for (auto [a, b] : v) {if (x <= a && y >= b) cnt[i]++;}}int maxim = *max_element(cnt.begin(), cnt.end());if (maxim == 0) {cout << 0 << endl;}else {rep(i, m) {if (cnt[i] == maxim) cout << i + 1 << endl;}}return 0;}