結果

問題 No.294 SuperFizzBuzz
ユーザー Yukino DX.Yukino DX.
提出日時 2023-10-31 22:26:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,464 ms / 5,000 ms
コード長 479 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 236,276 KB
最終ジャッジ日時 2023-10-31 22:27:13
合計ジャッジ時間 24,444 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,448 ms
236,276 KB
testcase_01 AC 1,427 ms
236,276 KB
testcase_02 AC 1,464 ms
236,276 KB
testcase_03 AC 1,439 ms
236,276 KB
testcase_04 AC 1,444 ms
236,276 KB
testcase_05 AC 1,438 ms
236,276 KB
testcase_06 AC 1,444 ms
236,276 KB
testcase_07 AC 1,443 ms
236,276 KB
testcase_08 AC 1,457 ms
236,276 KB
testcase_09 AC 1,438 ms
236,276 KB
testcase_10 AC 1,443 ms
236,276 KB
testcase_11 AC 1,436 ms
236,276 KB
testcase_12 AC 1,443 ms
236,276 KB
testcase_13 AC 1,438 ms
236,276 KB
testcase_14 AC 1,443 ms
236,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    start = 0
    for i in range(30):
        if x & (1 << i) != 0:
            start = i

    res = ""
    for i in range(start - 1, -1, -1):
        if x & (1 << i) != 0:
            res += "5"
        else:
            res += "3"

    return res


n = int(input())
xs = []
for d in range(3, 26):
    x = 0
    for _ in range(1 << d):
        x += 1
        if x & 1 != 0 and x.bit_count() % 3 == 0:
            xs.append((1 << d) | x)

ans = f(xs[n - 1])
print(ans)
0