結果

問題 No.1988 Divisor Tiling
ユーザー tassei903tassei903
提出日時 2022-06-24 21:57:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 76,740 KB
最終ジャッジ日時 2023-08-08 12:12:00
合計ジャッジ時間 4,938 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,340 KB
testcase_01 AC 72 ms
71,184 KB
testcase_02 AC 72 ms
71,068 KB
testcase_03 AC 72 ms
71,064 KB
testcase_04 AC 72 ms
71,256 KB
testcase_05 AC 72 ms
71,164 KB
testcase_06 AC 72 ms
71,448 KB
testcase_07 AC 72 ms
71,160 KB
testcase_08 AC 73 ms
71,468 KB
testcase_09 AC 74 ms
71,388 KB
testcase_10 AC 75 ms
71,204 KB
testcase_11 AC 73 ms
71,292 KB
testcase_12 AC 73 ms
71,452 KB
testcase_13 AC 75 ms
71,464 KB
testcase_14 AC 74 ms
71,440 KB
testcase_15 AC 74 ms
71,288 KB
testcase_16 AC 77 ms
71,444 KB
testcase_17 AC 72 ms
71,452 KB
testcase_18 AC 84 ms
76,524 KB
testcase_19 AC 83 ms
76,580 KB
testcase_20 AC 84 ms
76,312 KB
testcase_21 AC 83 ms
76,604 KB
testcase_22 AC 85 ms
76,552 KB
testcase_23 AC 85 ms
76,440 KB
testcase_24 AC 85 ms
76,604 KB
testcase_25 AC 85 ms
76,588 KB
testcase_26 AC 88 ms
76,328 KB
testcase_27 AC 90 ms
76,536 KB
testcase_28 AC 91 ms
76,676 KB
testcase_29 AC 97 ms
76,740 KB
testcase_30 AC 95 ms
76,688 KB
testcase_31 AC 85 ms
76,508 KB
testcase_32 AC 72 ms
71,408 KB
testcase_33 AC 71 ms
71,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n,h = na()
w = n//h
x = h
d = 1
while x % 2 == 0:
    x //= 2
if x != 1:
    h, w = w, h
    d = 0
z = 0
ans = [[-1 for j in range(w)]for i in range(h)]
for x in range(n-1,0,-1):
    if n % x:
        continue
    for i in range(x):
        ans[z//w][z%w] = x
        z += 1
if d:
    for i in ans:
        print(*i)
else:
    ans = zip(*[i for i in ans])
    for i in ans:
        print(*i)
0