結果

問題 No.1988 Divisor Tiling
ユーザー tassei903tassei903
提出日時 2022-06-24 21:55:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 66,928 KB
最終ジャッジ日時 2024-04-26 05:07:25
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,952 KB
testcase_01 WA -
testcase_02 AC 37 ms
54,000 KB
testcase_03 AC 37 ms
54,544 KB
testcase_04 AC 36 ms
52,748 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 38 ms
52,508 KB
testcase_08 AC 39 ms
52,808 KB
testcase_09 AC 38 ms
52,816 KB
testcase_10 AC 38 ms
53,488 KB
testcase_11 AC 39 ms
54,528 KB
testcase_12 AC 40 ms
54,408 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 40 ms
53,860 KB
testcase_18 AC 51 ms
64,536 KB
testcase_19 AC 54 ms
64,980 KB
testcase_20 AC 51 ms
65,196 KB
testcase_21 AC 53 ms
65,032 KB
testcase_22 AC 51 ms
64,420 KB
testcase_23 AC 51 ms
64,632 KB
testcase_24 AC 53 ms
66,708 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 51 ms
65,480 KB
testcase_32 AC 40 ms
54,244 KB
testcase_33 AC 37 ms
53,176 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
while x % 2 == 0:
    x //= 2
if x != 1:
    h, w = w, h
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 x == 1:
    for i in ans:
        print(*i)
else:
    ans = zip(*[i for i in ans])
    for i in ans:
        print(*i)
0