結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
70,592 KB
testcase_01 AC 68 ms
70,752 KB
testcase_02 AC 69 ms
70,672 KB
testcase_03 AC 67 ms
70,752 KB
testcase_04 AC 71 ms
70,816 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 70 ms
70,880 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 70 ms
70,804 KB
testcase_11 WA -
testcase_12 AC 68 ms
70,800 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 68 ms
70,636 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 69 ms
70,488 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 68 ms
70,756 KB
testcase_24 WA -
testcase_25 AC 69 ms
70,584 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 69 ms
70,740 KB
testcase_29 WA -
testcase_30 AC 67 ms
70,628 KB
権限があれば一括ダウンロードができます

ソースコード

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 min(H,W)>=3:
    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