Submission #4034632
Source Code Expand
n, k = map(int, input().split()) white = [[0 for _ in range(2*k+1)] for _ in range(2*k+1)] for _ in range(n): x, y, c = input().split() x, y = (int(x) - 1) % (2*k), (int(y) - 1) % (2*k) if (c == "B"): x = (x-k) % (2*k) if not ((x<k) ^ (y<k)): if y >= k: x, y = x-k, y-k white[0][0] += 1 white[x][0] += -1 white[x+k][0] += -1 white[2*k][0] += 1 white[0][y] += -1 white[x][y] += 2 white[x+k][y] += -2 white[2*k][y] += 1 white[0][y+k] += 1 white[x][y+k] += -2 white[x+k][y+k] += 2 white[2*k][y+k] += -1 white[0][2*k] += -1 white[x][2*k] += 1 white[x+k][2*k] += -1 white[2*k][2*k] += 1 else: if y >= k: x, y = x+k, y-k white[x-k][0] += 1 white[x][0] += -1 white[0][y] += 1 white[x-k][y] += -2 white[x][y] += 2 white[2*k][y] += -1 white[0][y+k] += -1 white[x-k][y+k] += 2 white[x][y+k] += -2 white[2*k][y+k] += 1 white[x-k][2*k] += -1 white[x][2*k] += 1 #print(white) for i in range(2*k+1): for j in range(2*k): white[i][j+1] += white[i][j] for j in range(2*k+1): for i in range(2*k): white[i+1][j] += white[i][j] #print(white) ans = 0 for i in range(2*k): for j in range(2*k): ans = max(ans, white[i][j]) print(ans)
Submission Info
Submission Time | |
---|---|
Task | D - Checker |
User | anagohirame |
Language | PyPy3 (2.4.0) |
Score | 500 |
Code Size | 1264 Byte |
Status | AC |
Exec Time | 1022 ms |
Memory | 92636 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt, 1_028.txt, 1_029.txt, 1_030.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 170 ms | 38256 KB |
0_001.txt | AC | 450 ms | 74844 KB |
0_002.txt | AC | 167 ms | 38256 KB |
1_003.txt | AC | 446 ms | 74716 KB |
1_004.txt | AC | 169 ms | 38256 KB |
1_005.txt | AC | 172 ms | 38256 KB |
1_006.txt | AC | 170 ms | 38256 KB |
1_007.txt | AC | 183 ms | 39536 KB |
1_008.txt | AC | 450 ms | 74716 KB |
1_009.txt | AC | 213 ms | 38768 KB |
1_010.txt | AC | 208 ms | 38768 KB |
1_011.txt | AC | 209 ms | 38768 KB |
1_012.txt | AC | 223 ms | 40048 KB |
1_013.txt | AC | 492 ms | 75228 KB |
1_014.txt | AC | 696 ms | 56792 KB |
1_015.txt | AC | 695 ms | 56552 KB |
1_016.txt | AC | 706 ms | 56664 KB |
1_017.txt | AC | 716 ms | 57944 KB |
1_018.txt | AC | 1022 ms | 91996 KB |
1_019.txt | AC | 302 ms | 47320 KB |
1_020.txt | AC | 301 ms | 47320 KB |
1_021.txt | AC | 304 ms | 47576 KB |
1_022.txt | AC | 303 ms | 47576 KB |
1_023.txt | AC | 320 ms | 48344 KB |
1_024.txt | AC | 315 ms | 48216 KB |
1_025.txt | AC | 698 ms | 57192 KB |
1_026.txt | AC | 964 ms | 92636 KB |
1_027.txt | AC | 620 ms | 51176 KB |
1_028.txt | AC | 913 ms | 85980 KB |
1_029.txt | AC | 619 ms | 50536 KB |
1_030.txt | AC | 929 ms | 86108 KB |