結果

問題 No.2339 Factorial Paths
ユーザー hir355hir355
提出日時 2023-06-02 22:41:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 108,712 KB
最終ジャッジ日時 2023-08-28 04:53:10
合計ジャッジ時間 11,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,492 KB
testcase_01 AC 71 ms
71,440 KB
testcase_02 WA -
testcase_03 AC 69 ms
71,316 KB
testcase_04 AC 71 ms
71,328 KB
testcase_05 AC 73 ms
71,080 KB
testcase_06 AC 70 ms
71,232 KB
testcase_07 AC 74 ms
71,088 KB
testcase_08 AC 88 ms
76,428 KB
testcase_09 AC 84 ms
77,024 KB
testcase_10 AC 90 ms
77,500 KB
testcase_11 AC 99 ms
79,008 KB
testcase_12 AC 102 ms
79,288 KB
testcase_13 AC 111 ms
81,332 KB
testcase_14 AC 132 ms
84,112 KB
testcase_15 AC 201 ms
90,984 KB
testcase_16 AC 276 ms
99,104 KB
testcase_17 AC 334 ms
105,144 KB
testcase_18 AC 351 ms
107,644 KB
testcase_19 AC 338 ms
107,704 KB
testcase_20 AC 353 ms
107,920 KB
testcase_21 AC 355 ms
108,712 KB
testcase_22 AC 350 ms
108,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = []
st = [n]
h, w = 1, 1
while st:
    p = st.pop()
    if p == 1:
        continue
    st.append(p // 2)
    st.append((p + 1) // 2)
    if h < w:
        l.append((p // 2, (p + 1) // 2))
        h += p // 2 + 1
        w += (p + 1) // 2 + 1
    else:
        l.append(((p + 1) // 2, p // 2))
        w += p // 2
        h += (p + 1) // 2
s = [['#'] * w for _ in range(h)]
p, q = 0, 0
for x, y in l:
    for j in range(p, p + x + 1):
        for k in range(q, q + y + 1):
            s[j][k] = '.'
    p += x
    q += y
print(h, w)
for row in s:
    print(*row, sep='')
0