結果

問題 No.1988 Divisor Tiling
ユーザー nikumakarenikumakare
提出日時 2022-06-24 21:33:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 70,996 KB
最終ジャッジ日時 2024-04-26 04:47:24
合計ジャッジ時間 5,015 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,292 KB
testcase_01 AC 40 ms
53,944 KB
testcase_02 AC 37 ms
52,956 KB
testcase_03 AC 38 ms
53,320 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 39 ms
52,312 KB
testcase_07 AC 38 ms
52,948 KB
testcase_08 AC 39 ms
53,792 KB
testcase_09 AC 39 ms
52,492 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 39 ms
53,020 KB
testcase_17 AC 41 ms
54,804 KB
testcase_18 AC 47 ms
64,504 KB
testcase_19 AC 48 ms
63,576 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 AC 57 ms
70,996 KB
testcase_31 AC 50 ms
63,792 KB
testcase_32 AC 38 ms
53,628 KB
testcase_33 AC 37 ms
52,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,h=map(int,input().split())
D=[]
for i in range(1,n):
    if n%i==0:
        D.append(i)

if h==1:
    P=[]
    for num in D:
        P.extend([num]*num)
    print(*P)

elif h==2:
    P=[]
    for num in D[:-1]:
        P.extend([num]*num)
    print(*P)
    print(*[D[-1]]*D[-1])

elif h==n//2:
    P=[]
    for num in D[:-1]:
        P.extend([num]*num)
    for num in P:
        print(num,D[-1])

elif h==n:
    P=[]
    for num in D:
        P.extend([num]*num)
    for num in P:
        print(num)

else:
    print(-1)
0