結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
Ichimiya
|
| 提出日時 | 2020-06-16 00:54:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 4,500 ms |
| コード長 | 804 bytes |
| コンパイル時間 | 1,616 ms |
| コンパイル使用メモリ | 171,808 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-03 11:42:50 |
| 合計ジャッジ時間 | 2,832 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
int main() {
int N, M;
cin >> N;
vector<pair<int, int>> v(N);
for (int i = 0; i < N; i++) {
cin >> v.at(i).first >> v.at(i).second;
}
cin >> M;
//cout << "M:" << M << endl;
vector<int> v2(M);
int max = 0;
for (int i = 0; i < M; i++) {
int x, y;
cin >> x >> y;
//cout << "x:" << x << ' ' << "y:" << y << endl;
for (int j = 0; j < N; j++) {
int a, b;
a = v.at(j).first;
b = v.at(j).second;
//cout << "a:" << a << ' ' << "b:" << b << endl;
if ((x <= a) && (y >= b)) v2.at(i)++;
if (v2.at(i) > max) max = v2.at(i);
}
}
if (!max) {
cout << 0 << endl;
return 0;
}
for (int i = 0; i < M; i++) {
//cout << v2.at(i) << endl;
if (v2.at(i) == max) {
cout << i + 1 << endl;
}
}
}
Ichimiya