Submission #4060052


Source Code Expand

H,W = map(int,input().split())

A=[]
for i in range(H):
    A.append(list(map(int,input().split())))

for i in range(H):
    for j in range(W):
        if i%2==0:
            n=j
        else:
            n=W-1-j
        if A[i][n]%2==1:
            A[i][n]-=1
            if i!=H-1 and (i%2==0 and n==W-1) or (i%2==1 and n==0):
                A[i+1][n]+=1
                print(i+1,n+1,i+2,n+1)
            if (i%2==0 and n!=W-1) or (i%2==1 and n!=0): 
                A[i][n+(-1)**(i%2)]+=1
                print(i+1,n+1,i+1,n+1+(-1)**(i%2))

Submission Info

Submission Time
Task D - Make Them Even
User nuko274
Language PyPy3 (2.4.0)
Score 0
Code Size 567 Byte
Status RE
Exec Time 510 ms
Memory 60892 KB

Judge Result

Set Name All Sample
Score / Max Score 0 / 400 0 / 0
Status
WA × 23
RE × 6
WA × 3
Set Name Test Cases
All hand_1, hand_2, hand_3, hand_4, hand_5, hand_6, max_1, max_10, max_2, max_3, max_4, max_5, max_6, max_7, max_8, max_9, random_1, random_10, random_2, random_3, random_4, random_5, random_6, random_7, random_8, random_9, sample_01, sample_02, sample_03
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_1 WA 176 ms 38256 KB
hand_2 WA 176 ms 38256 KB
hand_3 WA 196 ms 39024 KB
hand_4 WA 232 ms 42224 KB
hand_5 WA 493 ms 60124 KB
hand_6 WA 263 ms 43100 KB
max_1 RE 510 ms 60636 KB
max_10 WA 500 ms 59868 KB
max_2 WA 507 ms 60636 KB
max_3 RE 496 ms 59996 KB
max_4 WA 495 ms 60380 KB
max_5 RE 485 ms 60252 KB
max_6 WA 488 ms 60892 KB
max_7 WA 490 ms 60636 KB
max_8 WA 486 ms 60252 KB
max_9 RE 490 ms 59740 KB
random_1 RE 229 ms 43120 KB
random_10 WA 309 ms 50012 KB
random_2 WA 328 ms 50520 KB
random_3 WA 353 ms 52700 KB
random_4 WA 306 ms 49004 KB
random_5 RE 306 ms 49116 KB
random_6 WA 361 ms 52696 KB
random_7 WA 338 ms 51804 KB
random_8 WA 362 ms 53084 KB
random_9 WA 420 ms 56540 KB
sample_01 WA 173 ms 38256 KB
sample_02 WA 175 ms 38256 KB
sample_03 WA 172 ms 38256 KB