結果

問題 No.647 明太子
ユーザー ninoinuininoinui
提出日時 2020-02-14 01:31:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 1,657 ms
コンパイル使用メモリ 168,832 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 23:34:45
合計ジャッジ時間 2,810 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 5 ms
5,376 KB
testcase_14 AC 28 ms
5,376 KB
testcase_15 AC 6 ms
5,376 KB
testcase_16 AC 4 ms
5,376 KB
testcase_17 AC 35 ms
5,376 KB
testcase_18 AC 36 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 26 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<pair<int, int>> AB(N), XY;
  for (int i = 0, a, b; i < N && cin >> a >> b; i++) AB.at(i) = {a, b};
  int M;
  cin >> M;
  XY.resize(M);
  for (int i = 0, x, y; cin >> x >> y; i++) XY.at(i) = {x, y};
  vector<int> V(M);
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      if (AB.at(i).first >= XY.at(j).first && AB.at(i).second <= XY.at(j).second) V.at(j)++;
  int ma = *max_element(V.begin(), V.end());
  for (int i = 0; i < M; i++) if (V.at(i) == ma) cout << i + 1 << "\n";
}
0