結果
問題 |
No.294 SuperFizzBuzz
|
ユーザー |
|
提出日時 | 2023-10-31 22:26:48 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,606 ms / 5,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 566 ms |
コンパイル使用メモリ | 82,144 KB |
実行使用メモリ | 236,624 KB |
最終ジャッジ日時 | 2024-09-25 17:44:42 |
合計ジャッジ時間 | 26,344 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
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)