結果

問題 No.1988 Divisor Tiling
ユーザー tassei903tassei903
提出日時 2022-06-24 21:57:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 71,424 KB
最終ジャッジ日時 2024-04-26 05:08:36
合計ジャッジ時間 3,059 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,352 KB
testcase_01 AC 39 ms
52,352 KB
testcase_02 AC 36 ms
52,224 KB
testcase_03 AC 36 ms
52,352 KB
testcase_04 AC 36 ms
52,096 KB
testcase_05 AC 36 ms
52,480 KB
testcase_06 AC 35 ms
52,480 KB
testcase_07 AC 36 ms
52,480 KB
testcase_08 AC 39 ms
52,864 KB
testcase_09 AC 39 ms
52,864 KB
testcase_10 AC 39 ms
53,376 KB
testcase_11 AC 39 ms
52,608 KB
testcase_12 AC 38 ms
53,120 KB
testcase_13 AC 38 ms
53,376 KB
testcase_14 AC 38 ms
53,248 KB
testcase_15 AC 39 ms
52,992 KB
testcase_16 AC 40 ms
53,248 KB
testcase_17 AC 39 ms
53,120 KB
testcase_18 AC 54 ms
64,640 KB
testcase_19 AC 52 ms
64,512 KB
testcase_20 AC 53 ms
64,000 KB
testcase_21 AC 59 ms
64,640 KB
testcase_22 AC 55 ms
64,384 KB
testcase_23 AC 53 ms
64,512 KB
testcase_24 AC 52 ms
64,640 KB
testcase_25 AC 53 ms
64,896 KB
testcase_26 AC 54 ms
66,176 KB
testcase_27 AC 58 ms
67,328 KB
testcase_28 AC 60 ms
68,480 KB
testcase_29 AC 67 ms
71,424 KB
testcase_30 AC 61 ms
71,296 KB
testcase_31 AC 52 ms
65,536 KB
testcase_32 AC 37 ms
52,736 KB
testcase_33 AC 37 ms
51,968 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