Submission #19550374


Source Code Expand

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

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

cnt = 0
ans = []
for h in range(H):
    for w in range(W - 1):
        if A[h][w] % 2 == 1:
            ans.append([h + 1, w + 1, h + 1, w + 2])
            A[h][w + 1] += 1

for h in range(H - 1):
    if A[h][W - 1] % 2 == 1:
        ans.append([h + 1, W, h + 2, W])
        A[h + 1][W - 1] += 1

print(len(ans))
for ope in ans:
    print(*ope)

Submission Info

Submission Time
Task D - Make Them Even
User aufy
Language PyPy3 (7.3.0)
Score 400
Code Size 490 Byte
Status AC
Exec Time 194 ms
Memory 88644 KB

Judge Result

Set Name All Sample
Score / Max Score 400 / 400 0 / 0
Status
AC × 29
AC × 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 AC 68 ms 61620 KB
hand_2 AC 51 ms 61736 KB
hand_3 AC 62 ms 67724 KB
hand_4 AC 74 ms 68316 KB
hand_5 AC 187 ms 88312 KB
hand_6 AC 85 ms 69520 KB
max_1 AC 186 ms 88384 KB
max_10 AC 185 ms 88344 KB
max_2 AC 182 ms 87936 KB
max_3 AC 184 ms 88188 KB
max_4 AC 189 ms 88500 KB
max_5 AC 194 ms 88624 KB
max_6 AC 180 ms 88456 KB
max_7 AC 182 ms 88104 KB
max_8 AC 186 ms 88644 KB
max_9 AC 189 ms 88464 KB
random_1 AC 73 ms 68476 KB
random_10 AC 100 ms 71936 KB
random_2 AC 106 ms 72980 KB
random_3 AC 116 ms 75048 KB
random_4 AC 93 ms 70792 KB
random_5 AC 102 ms 71416 KB
random_6 AC 128 ms 77612 KB
random_7 AC 115 ms 74960 KB
random_8 AC 122 ms 76452 KB
random_9 AC 140 ms 79796 KB
sample_01 AC 53 ms 61892 KB
sample_02 AC 49 ms 61848 KB
sample_03 AC 49 ms 61684 KB