結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー H3PO4H3PO4
提出日時 2021-02-19 21:55:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 11,216 KB
最終ジャッジ日時 2023-10-15 01:17:21
合計ジャッジ時間 24,849 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,832 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 15 ms
8,084 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 WA -
testcase_07 AC 15 ms
8,120 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
8,124 KB
testcase_11 WA -
testcase_12 AC 15 ms
8,152 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 102 ms
10,952 KB
testcase_17 AC 100 ms
11,140 KB
testcase_18 AC 100 ms
11,088 KB
testcase_19 AC 100 ms
11,140 KB
testcase_20 AC 15 ms
8,064 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 15 ms
8,132 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 15 ms
8,204 KB
testcase_29 WA -
testcase_30 AC 16 ms
8,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_impossible(flag):
    if flag:
        print(-1)
        exit()


W, H, X = map(int, input().split())
is_impossible(X > 36)
is_impossible(W % 3 != 2 or W % 3 != 2)
M = [[0] * W for _ in range(H)]
for i in range(0, H, 3):
    for j in range(0, W, 3):
        M[i][j] = X//4
        M[i][j+1] = (X+1)//4
        M[i+1][j] = (X+2)//4
        M[i+1][j+1] = (X+3)//4
for m in M:
    print(''.join(map(str, m)))
0