Submission #62303231
Source Code Expand
Copy
N, W = map(int, input().split())X, Y = [], []B = [[] for _ in range(W)]E = [10**9+10 for _ in range(N)]for i in range(N):x, y = map(int, input().split())X.append(x-1)Y.append(y-1)B[x-1].append((y-1, i))T, A = [], []Q = int(input())for _ in range(Q):t, a = map(int, input().split())T.append(t)A.append(a-1)mT = 0mB = min(map(len, B))for i in range(mB):As = []
N, W = map(int, input().split()) X, Y = [], [] B = [[] for _ in range(W)] E = [10**9+10 for _ in range(N)] for i in range(N): x, y = map(int, input().split()) X.append(x-1) Y.append(y-1) B[x-1].append((y-1, i)) T, A = [], [] Q = int(input()) for _ in range(Q): t, a = map(int, input().split()) T.append(t) A.append(a-1) mT = 0 mB = min(map(len, B)) for i in range(mB): As = [] my = 0 for j in range(W): y, a = B[j][i] As.append(a) my = max(my, max(mT, y)) for a in As: E[a] = my + 1 mT = my for q in range(Q): t, a = T[q], A[q] if E[a] <= t: print("No") else: print("Yes")
Submission Info
Submission Time | |
---|---|
Task | D - Gravity |
User | KNSN92 |
Language | Python (PyPy 3.10-v7.3.12) |
Score | 400 |
Code Size | 722 Byte |
Status | AC |
Exec Time | 265 ms |
Memory | 134180 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 57 ms | 76368 KB |
00_sample_02.txt | AC | 55 ms | 76636 KB |
01_test_01.txt | AC | 154 ms | 94560 KB |
01_test_02.txt | AC | 247 ms | 119636 KB |
01_test_03.txt | AC | 209 ms | 105564 KB |
01_test_04.txt | AC | 254 ms | 119576 KB |
01_test_05.txt | AC | 214 ms | 105484 KB |
01_test_06.txt | AC | 261 ms | 116468 KB |
01_test_07.txt | AC | 144 ms | 93428 KB |
01_test_08.txt | AC | 252 ms | 118536 KB |
01_test_09.txt | AC | 222 ms | 108972 KB |
01_test_10.txt | AC | 243 ms | 116376 KB |
01_test_11.txt | AC | 192 ms | 104568 KB |
01_test_12.txt | AC | 253 ms | 118468 KB |
01_test_13.txt | AC | 205 ms | 105204 KB |
01_test_14.txt | AC | 253 ms | 115372 KB |
01_test_15.txt | AC | 164 ms | 97764 KB |
01_test_16.txt | AC | 255 ms | 125708 KB |
01_test_17.txt | AC | 162 ms | 98152 KB |
01_test_18.txt | AC | 244 ms | 119180 KB |
01_test_19.txt | AC | 115 ms | 86640 KB |
01_test_20.txt | AC | 250 ms | 121764 KB |
01_test_21.txt | AC | 209 ms | 111304 KB |
01_test_22.txt | AC | 244 ms | 118436 KB |
01_test_23.txt | AC | 221 ms | 109532 KB |
01_test_24.txt | AC | 248 ms | 115692 KB |
01_test_25.txt | AC | 223 ms | 116672 KB |
01_test_26.txt | AC | 265 ms | 134180 KB |