結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー KudeKude
提出日時 2021-02-19 22:04:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 3,153 ms
コード長 427 bytes
コンパイル時間 1,732 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 83,428 KB
最終ジャッジ日時 2023-10-15 01:48:23
合計ジャッジ時間 30,029 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,196 KB
testcase_01 AC 74 ms
71,140 KB
testcase_02 AC 76 ms
71,196 KB
testcase_03 AC 74 ms
71,392 KB
testcase_04 AC 76 ms
71,212 KB
testcase_05 AC 75 ms
71,356 KB
testcase_06 AC 132 ms
83,144 KB
testcase_07 AC 75 ms
71,140 KB
testcase_08 AC 130 ms
83,428 KB
testcase_09 AC 135 ms
83,252 KB
testcase_10 AC 75 ms
70,988 KB
testcase_11 AC 133 ms
83,336 KB
testcase_12 AC 74 ms
71,296 KB
testcase_13 AC 132 ms
83,200 KB
testcase_14 AC 131 ms
83,200 KB
testcase_15 AC 78 ms
71,432 KB
testcase_16 AC 134 ms
83,392 KB
testcase_17 AC 135 ms
83,104 KB
testcase_18 AC 133 ms
82,984 KB
testcase_19 AC 132 ms
83,220 KB
testcase_20 AC 71 ms
71,368 KB
testcase_21 AC 131 ms
83,228 KB
testcase_22 AC 130 ms
83,408 KB
testcase_23 AC 77 ms
71,428 KB
testcase_24 AC 127 ms
83,228 KB
testcase_25 AC 75 ms
71,084 KB
testcase_26 AC 130 ms
83,308 KB
testcase_27 AC 131 ms
83,344 KB
testcase_28 AC 78 ms
71,108 KB
testcase_29 AC 132 ms
83,280 KB
testcase_30 AC 77 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w, h, x = map(int, input().split())
d = [[0] * 3 for _ in range(3)]
for i in range(3):
    for j in range(3):
        if h % 3 != i % 3 != 2 and w % 3 != j % 3 != 2:
            d[i][j] = min(x, 9)
            x -= d[i][j]
if x:
    print(-1)
    exit()
ans = []
for i in range(h):
    ans.append([])
    for j in range(w):
        ans[-1].append(d[i%3][j%3])

for t in ans:
    for x in t:
        print(x, end='')
    print()
0