結果

問題 No.1988 Divisor Tiling
ユーザー ああいいああいい
提出日時 2022-06-26 19:36:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 1,768 ms
コンパイル使用メモリ 86,436 KB
実行使用メモリ 77,372 KB
最終ジャッジ日時 2023-08-10 21:25:24
合計ジャッジ時間 5,790 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,200 KB
testcase_01 AC 70 ms
71,364 KB
testcase_02 AC 65 ms
70,884 KB
testcase_03 AC 66 ms
71,292 KB
testcase_04 AC 67 ms
71,200 KB
testcase_05 AC 68 ms
71,360 KB
testcase_06 AC 70 ms
71,196 KB
testcase_07 AC 64 ms
71,252 KB
testcase_08 AC 66 ms
71,232 KB
testcase_09 AC 68 ms
71,152 KB
testcase_10 AC 67 ms
71,208 KB
testcase_11 AC 67 ms
71,316 KB
testcase_12 AC 67 ms
71,356 KB
testcase_13 AC 68 ms
71,248 KB
testcase_14 AC 76 ms
71,220 KB
testcase_15 AC 73 ms
71,132 KB
testcase_16 AC 70 ms
70,984 KB
testcase_17 AC 72 ms
71,292 KB
testcase_18 AC 99 ms
76,668 KB
testcase_19 AC 81 ms
76,780 KB
testcase_20 AC 78 ms
76,612 KB
testcase_21 AC 76 ms
76,432 KB
testcase_22 AC 78 ms
76,428 KB
testcase_23 AC 80 ms
76,476 KB
testcase_24 AC 84 ms
76,480 KB
testcase_25 AC 90 ms
76,780 KB
testcase_26 AC 97 ms
76,664 KB
testcase_27 AC 93 ms
76,792 KB
testcase_28 AC 90 ms
76,780 KB
testcase_29 AC 98 ms
77,372 KB
testcase_30 AC 91 ms
76,780 KB
testcase_31 AC 88 ms
76,620 KB
testcase_32 AC 68 ms
71,152 KB
testcase_33 AC 66 ms
71,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,H = map(int,input().split())

if N == 6:p = 3
elif N == 28:p = 7
elif N == 496:p = 31
else:p = 127

x = N // H
ans = [[]]
if H % p == 0:
    flag = True
    x,H = H,x
else:
    flag = False


for i in range(1,N):
    if N % i != 0:continue
    if i < x:
        for _ in range(i):
            ans[0].append(i)
    else:
        q = i // x
        for _ in range(q):
            ans.append([])
            for __ in range(x):
                ans[-1].append(i)
if flag == False:
    for _ in range(H):
        print(*ans[_])
else:
    #print(ans)
    for w in range(x):
        for j in range(H):
            print(ans[j][w],end = " ")
        print()
        
0