結果

問題 No.2422 regisys?
ユーザー a01sa01toa01sa01to
提出日時 2023-08-12 14:45:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 920 bytes
コンパイル時間 2,207 ms
コンパイル使用メモリ 208,496 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2024-04-30 07:09:23
合計ジャッジ時間 17,259 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
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 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 222 ms
11,008 KB
testcase_32 AC 253 ms
9,600 KB
testcase_33 AC 197 ms
11,008 KB
testcase_34 AC 80 ms
5,504 KB
testcase_35 AC 246 ms
12,928 KB
testcase_36 AC 158 ms
7,424 KB
testcase_37 AC 286 ms
10,624 KB
testcase_38 AC 139 ms
6,016 KB
testcase_39 AC 98 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 109 ms
6,656 KB
testcase_42 AC 468 ms
20,352 KB
testcase_43 AC 203 ms
9,344 KB
testcase_44 AC 547 ms
20,608 KB
testcase_45 AC 421 ms
18,048 KB
testcase_46 AC 525 ms
20,480 KB
testcase_47 WA -
testcase_48 AC 523 ms
22,784 KB
testcase_49 WA -
testcase_50 AC 448 ms
22,144 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 613 ms
23,040 KB
testcase_55 AC 501 ms
21,120 KB
testcase_56 AC 325 ms
13,440 KB
testcase_57 AC 854 ms
23,552 KB
testcase_58 AC 870 ms
23,552 KB
testcase_59 AC 822 ms
23,552 KB
testcase_60 AC 851 ms
23,552 KB
testcase_61 AC 2 ms
5,376 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, 1e9 });
    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