Submission #65258312


Source Code Expand

#if !__INCLUDE_LEVEL__
#include __FILE__

void solve() {
    int n, m;
    cin >> n >> m;

    basic_string<bool> allof(n, false);
    vector<set<int>> vs(n, set<int>());

    int q;
    cin >> q;
    while (q--) {
        int t;
        cin >> t;
        if (t == 1) {
            int x, y;
            cin >> x >> y, x--, y--;
            vs[x].insert(y);
        }
        if (t == 2) {
            int x;
            cin >> x, x--;
            allof[x] = true;
        }
        if (t == 3) {
            int x, y;
            cin >> x >> y, x--, y--;
            res(vs[x].count(y) || allof[x]);
        }
    }
}

int main() {
    // cin.tie(nullptr)->ios_base::sync_with_stdio(false);
    int ts = 1;
    // scanf("%d", &ts);
    for (int ti = 0; ti < ts; ti++) solve();
}

#else

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

// #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("avx2")

#define overload4(x, y, z, v, w, ...) w
#define rep1(i) for (int i = 0; i < 1e9 + 7; i++)
#define rep2(i, n) for (int i = 0; i < (int)(n); i++)
#define rep3(i, a, l) for (int i = a; i < (int)(l); i++)
#define rep4(i, a, l, d) for (int i = a; i < (int)(l); i += d)
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define siz(obj) ((int)(obj).size())
#define F first
#define S second
#define _1LL __int128_t(1)

using ll = long long;
using LL = __int128_t;
using P = pair<int, int>;

constexpr int inf = INT_MAX/2;
constexpr long long linf = LLONG_MAX/2;

void res(bool f) { printf("%s\n", f ? "Yes" : "No"); }
void resex(bool f) { printf("%s\n", f ? "Yes" : "No"); exit(0); }
template<typename T> inline bool chmax(T& a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T& a, T b) { return ((a > b) ? (a = b, true) : (false)); }

#endif

Submission Info

Submission Time
Task C - 403 Forbidden
User sikk022
Language C++ 20 (gcc 12.2)
Score 300
Code Size 2065 Byte
Status AC
Exec Time 207 ms
Memory 17324 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 43
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt, 01_random_34.txt, 01_random_35.txt, 01_random_36.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3660 KiB
00_sample_02.txt AC 1 ms 3468 KiB
01_random_01.txt AC 124 ms 3552 KiB
01_random_02.txt AC 152 ms 3624 KiB
01_random_03.txt AC 165 ms 3588 KiB
01_random_04.txt AC 144 ms 3660 KiB
01_random_05.txt AC 132 ms 4272 KiB
01_random_06.txt AC 161 ms 4276 KiB
01_random_07.txt AC 177 ms 4356 KiB
01_random_08.txt AC 146 ms 3400 KiB
01_random_09.txt AC 148 ms 6572 KiB
01_random_10.txt AC 186 ms 7720 KiB
01_random_11.txt AC 202 ms 8220 KiB
01_random_12.txt AC 151 ms 3484 KiB
01_random_13.txt AC 133 ms 5116 KiB
01_random_14.txt AC 163 ms 5412 KiB
01_random_15.txt AC 176 ms 5384 KiB
01_random_16.txt AC 149 ms 3508 KiB
01_random_17.txt AC 139 ms 6320 KiB
01_random_18.txt AC 174 ms 7288 KiB
01_random_19.txt AC 189 ms 7532 KiB
01_random_20.txt AC 149 ms 3636 KiB
01_random_21.txt AC 149 ms 6652 KiB
01_random_22.txt AC 186 ms 7732 KiB
01_random_23.txt AC 203 ms 8260 KiB
01_random_24.txt AC 155 ms 3524 KiB
01_random_25.txt AC 147 ms 15788 KiB
01_random_26.txt AC 182 ms 16788 KiB
01_random_27.txt AC 196 ms 17304 KiB
01_random_28.txt AC 168 ms 12644 KiB
01_random_29.txt AC 156 ms 15848 KiB
01_random_30.txt AC 188 ms 16896 KiB
01_random_31.txt AC 201 ms 17320 KiB
01_random_32.txt AC 172 ms 12592 KiB
01_random_33.txt AC 160 ms 15836 KiB
01_random_34.txt AC 194 ms 16960 KiB
01_random_35.txt AC 207 ms 17324 KiB
01_random_36.txt AC 173 ms 12708 KiB
02_handmade_01.txt AC 5 ms 12564 KiB
02_handmade_02.txt AC 5 ms 12636 KiB
02_handmade_03.txt AC 203 ms 7204 KiB
02_handmade_04.txt AC 203 ms 7168 KiB
02_handmade_05.txt AC 144 ms 15288 KiB