結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー 👑 KazunKazun
提出日時 2021-02-19 21:38:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 1,860 ms
コンパイル使用メモリ 86,716 KB
実行使用メモリ 71,400 KB
最終ジャッジ日時 2023-10-15 00:14:00
合計ジャッジ時間 25,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
70,868 KB
testcase_01 AC 68 ms
71,068 KB
testcase_02 WA -
testcase_03 AC 62 ms
71,076 KB
testcase_04 AC 68 ms
71,200 KB
testcase_05 WA -
testcase_06 AC 70 ms
70,816 KB
testcase_07 WA -
testcase_08 AC 69 ms
71,052 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 69 ms
70,992 KB
testcase_14 AC 69 ms
70,932 KB
testcase_15 WA -
testcase_16 AC 70 ms
70,968 KB
testcase_17 AC 70 ms
70,896 KB
testcase_18 AC 68 ms
70,964 KB
testcase_19 AC 67 ms
70,900 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if H==W==1:
    print(X if X<=9 else -1)
    exit()
elif H==1 and W==2:
    if X<=18:
        p=min(9,X)
        q=X-p
        print(p,q)
    else:
        print(-1)
    exit()
elif H==2 and W==1:
    if X<=18:
        p=min(9,X)
        q=X-p
        print(p,q,sep="\n")
    else:
        print(-1)
    exit()

if X>36 or H%3==0 or W%3==0:
    print(-1)

P=[0]*4
Y=X
for i in range(4):
    a=min(Y,9)
    P[i]=a
    Y-=a

Q=[[P[0],P[1],0],[P[2],P[3],0],[0,0,0]]
R=[("{}{}{}".format(x[0],x[1],x[2]))*W for x in Q]

for i in range(H):
    print(R[i%3][:W])
0