結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー 👑 KazunKazun
提出日時 2021-02-19 21:31:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 86,368 KB
実行使用メモリ 71,268 KB
最終ジャッジ日時 2023-10-14 23:58:41
合計ジャッジ時間 27,374 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,904 KB
testcase_01 AC 70 ms
70,888 KB
testcase_02 AC 70 ms
70,908 KB
testcase_03 AC 70 ms
71,268 KB
testcase_04 AC 69 ms
71,040 KB
testcase_05 WA -
testcase_06 AC 73 ms
70,960 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,148 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 74 ms
71,044 KB
testcase_14 AC 73 ms
70,936 KB
testcase_15 WA -
testcase_16 AC 74 ms
71,120 KB
testcase_17 AC 73 ms
70,992 KB
testcase_18 AC 75 ms
71,224 KB
testcase_19 AC 76 ms
70,996 KB
testcase_20 AC 73 ms
71,088 KB
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:
    print(-1)
    exit()

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