Created
January 13, 2026 06:58
-
-
Save maehrm/b823838ba20c8d0f575777c2c9ba9455 to your computer and use it in GitHub Desktop.
C - 403 Forbidden https://atcoder.jp/contests/abc403/tasks/abc403_c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| N, M, Q = map(int, input().split()) | |
| contests = [set() for _ in range(N)] | |
| all_ok = [False] * N | |
| for _ in range(Q): | |
| t, *query = map(int, input().split()) | |
| if t == 1: | |
| x, y = query[0] - 1, query[1] - 1 | |
| contests[x].add(y) | |
| elif t == 2: | |
| x = query[0] - 1 | |
| all_ok[x] = True | |
| else: | |
| x, y = query[0] - 1, query[1] - 1 | |
| if all_ok[x]: | |
| print("Yes") | |
| else: | |
| print("Yes" if y in contests[x] else "No") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment