QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#378138 | #7926. Color Inversion on a Huge Chessboard | kevinyang# | WA | 7ms | 9952kb | Python3 | 631b | 2024-04-06 06:54:59 | 2024-04-06 06:55:00 |
Judging History
answer
n, q = [int(i) for i in input().split()]
a = [i%2 for i in range(n)]
b = [i%2 for i in range(n)]
acnt = n
bcnt = n
print(acnt, bcnt)
def toggle(arr, pos):
arr[pos] = 1-arr[pos]
if pos == 0:
return -1 if arr[0] == arr[1] else 1
if pos == n-1:
return -1 if arr[n-1] == arr[n-2] else 1
return -2 if arr[pos-1] == arr[pos] == arr[pos+1] else 2
for _ in range(q):
type, pos = input().split()
pos = int(pos)
pos -= 1
if type == 'COLUMN':
acnt += toggle(a, pos)
if type == 'ROW':
bcnt += toggle(b, pos)
print(acnt*bcnt)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 7ms
memory: 9952kb
input:
3 3 ROW 2 COLUMN 3 ROW 2
output:
3 3 3 2 6
result:
wrong answer 1st lines differ - expected: '3', found: '3 3'