結果

問題 No.2422 regisys?
ユーザー a01sa01toa01sa01to
提出日時 2023-08-12 14:46:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 920 bytes
コンパイル時間 1,983 ms
コンパイル使用メモリ 208,540 KB
実行使用メモリ 23,680 KB
最終ジャッジ日時 2024-04-30 07:10:43
合計ジャッジ時間 13,249 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 1 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 1 ms
6,940 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 162 ms
11,008 KB
testcase_32 AC 202 ms
9,600 KB
testcase_33 AC 146 ms
11,008 KB
testcase_34 AC 72 ms
6,940 KB
testcase_35 AC 181 ms
12,928 KB
testcase_36 AC 129 ms
7,552 KB
testcase_37 AC 219 ms
10,624 KB
testcase_38 AC 122 ms
6,944 KB
testcase_39 AC 85 ms
6,940 KB
testcase_40 WA -
testcase_41 AC 95 ms
6,944 KB
testcase_42 AC 340 ms
20,352 KB
testcase_43 AC 156 ms
9,344 KB
testcase_44 AC 409 ms
20,608 KB
testcase_45 AC 306 ms
18,176 KB
testcase_46 AC 383 ms
20,352 KB
testcase_47 WA -
testcase_48 AC 372 ms
22,784 KB
testcase_49 WA -
testcase_50 AC 340 ms
22,144 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 463 ms
23,040 KB
testcase_55 AC 377 ms
21,120 KB
testcase_56 AC 269 ms
13,440 KB
testcase_57 AC 677 ms
23,552 KB
testcase_58 AC 654 ms
23,552 KB
testcase_59 AC 662 ms
23,552 KB
testcase_60 AC 658 ms
23,680 KB
testcase_61 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];
  multiset<pair<int, int>> general, mma;
  rep(i, n) {
    general.insert({ a[i], b[i] });
    mma.insert({ b[i], a[i] });
  }
  rep(_, m) {
    int t, c;
    cin >> t >> c;
    auto&& my = (t == 0 ? general : mma);
    auto&& opp = (t == 0 ? mma : general);

    auto itr = my.upper_bound({ c, 2e9 });
    if (itr == my.begin()) continue;
    auto [a, b] = *prev(itr);
    auto itr1 = my.find({ a, b });
    my.erase(itr1);
    auto itr2 = opp.find({ b, a });
    opp.erase(itr2);
  }
  assert(general.size() == mma.size());
  cout << general.size() << endl;
  return 0;
}
0