結果
問題 | No.647 明太子 |
ユーザー |
![]() |
提出日時 | 2018-02-09 22:29:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 42 ms / 4,500 ms |
コード長 | 775 bytes |
コンパイル時間 | 662 ms |
コンパイル使用メモリ | 76,532 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 02:28:31 |
合計ジャッジ時間 | 1,580 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <algorithm>#include <cstdio>#include <cstring>#include <cmath>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);for (int j = 0; j < m; j++) {int x, y;cin >> x >> y;for (int i = 0; i < n; i++) {if (x <= a[i] && y >= b[i]) c[j]++;}}int r = 0;for (int j = 0; j < m; j++) {r = max(r, c[j]);}if (r == 0) {cout << 0 << endl;} else {for (int j = 0; j < m; j++) {if (c[j] == r) cout << j + 1 << '\n';}}return 0;}