Submission #1487383


Source Code Expand

Copy
ri = lambda: map(int, raw_input().split())
def pi(a): print (' '.join(map(str, a)))

h, w = ri()
n = input()
a = ri()

g = [[i + 1] * x for i, x in enumerate(a)]
g = [x for l in g for x in l]

for i in xrange(h):
    l = g[i*w:i*w+w]
    if i & 1:
        l = l[::-1]
    pi(l)

Submission Info

Submission Time
Task D - Grid Coloring
User cchao
Language PyPy2 (5.6.0)
Score 400
Code Size 293 Byte
Status
Exec Time 52 ms
Memory 33052 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_00.txt, 0_01.txt, 0_02.txt
All 400 / 400 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt
Case Name Status Exec Time Memory
0_00.txt 34 ms 27628 KB
0_01.txt 33 ms 27372 KB
0_02.txt 33 ms 26988 KB
1_00.txt 33 ms 26732 KB
1_01.txt 33 ms 27372 KB
1_02.txt 35 ms 28524 KB
1_03.txt 48 ms 30060 KB
1_04.txt 47 ms 33004 KB
1_05.txt 52 ms 33052 KB
1_06.txt 39 ms 29292 KB
1_07.txt 34 ms 27756 KB
1_08.txt 33 ms 26732 KB
1_09.txt 35 ms 27884 KB
1_10.txt 33 ms 27884 KB
1_11.txt 33 ms 26860 KB
1_12.txt 33 ms 27500 KB
1_13.txt 51 ms 33052 KB
1_14.txt 33 ms 26860 KB
1_15.txt 37 ms 29036 KB
1_16.txt 33 ms 27372 KB
1_17.txt 39 ms 29164 KB
1_18.txt 36 ms 29548 KB
1_19.txt 36 ms 29036 KB
1_20.txt 33 ms 27372 KB
1_21.txt 34 ms 28396 KB