Submission #65247316


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) debug(x), debug(y)
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))
#define sz(x) (int)(x.size())
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
const int mxN = 2e5 + 5;

set<int> vis[mxN];
int uwu[mxN];

void solve(){
	int n, m, q;
	cin >> n >> m >> q;
	rep(i, q){
		int t;
		cin >> t;
		if(t == 1){
			int x, y;
			cin >> x >> y;
			if(!uwu[x]) vis[x].insert(y);
		}
		else if(t == 2){
			int x;
			cin >> x;
			uwu[x] = 1;
		}
		else if(t == 3){
			int x, y;
			cin >> x >> y;
			if(uwu[x] || vis[x].find(y) != vis[x].end()){
				cout << "Yes\n";
			}
			else cout << "No\n";
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int t = 1;
	//cin >> t;
	while(t--) solve();
	return 0;
}

Submission Info

Submission Time
Task C - 403 Forbidden
User eggag32
Language C++ 20 (gcc 12.2)
Score 300
Code Size 1341 Byte
Status AC
Exec Time 66 ms
Memory 17712 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 5 ms 12800 KiB
00_sample_02.txt AC 5 ms 12844 KiB
01_random_01.txt AC 23 ms 12792 KiB
01_random_02.txt AC 24 ms 12820 KiB
01_random_03.txt AC 34 ms 13088 KiB
01_random_04.txt AC 22 ms 12680 KiB
01_random_05.txt AC 23 ms 12784 KiB
01_random_06.txt AC 26 ms 12728 KiB
01_random_07.txt AC 43 ms 13528 KiB
01_random_08.txt AC 23 ms 12908 KiB
01_random_09.txt AC 25 ms 12784 KiB
01_random_10.txt AC 27 ms 12868 KiB
01_random_11.txt AC 65 ms 17484 KiB
01_random_12.txt AC 24 ms 12848 KiB
01_random_13.txt AC 23 ms 13020 KiB
01_random_14.txt AC 25 ms 12836 KiB
01_random_15.txt AC 44 ms 14716 KiB
01_random_16.txt AC 22 ms 12796 KiB
01_random_17.txt AC 24 ms 12872 KiB
01_random_18.txt AC 26 ms 13088 KiB
01_random_19.txt AC 54 ms 16800 KiB
01_random_20.txt AC 22 ms 12792 KiB
01_random_21.txt AC 25 ms 12816 KiB
01_random_22.txt AC 28 ms 12948 KiB
01_random_23.txt AC 58 ms 17480 KiB
01_random_24.txt AC 24 ms 12852 KiB
01_random_25.txt AC 37 ms 16204 KiB
01_random_26.txt AC 46 ms 17504 KiB
01_random_27.txt AC 50 ms 17516 KiB
01_random_28.txt AC 32 ms 13636 KiB
01_random_29.txt AC 40 ms 16208 KiB
01_random_30.txt AC 47 ms 17656 KiB
01_random_31.txt AC 52 ms 17544 KiB
01_random_32.txt AC 31 ms 13604 KiB
01_random_33.txt AC 39 ms 16400 KiB
01_random_34.txt AC 53 ms 17712 KiB
01_random_35.txt AC 51 ms 17452 KiB
01_random_36.txt AC 33 ms 13560 KiB
02_handmade_01.txt AC 5 ms 12896 KiB
02_handmade_02.txt AC 5 ms 12852 KiB
02_handmade_03.txt AC 64 ms 16540 KiB
02_handmade_04.txt AC 66 ms 16516 KiB
02_handmade_05.txt AC 36 ms 15948 KiB