結果
問題 |
No.294 SuperFizzBuzz
|
ユーザー |
![]() |
提出日時 | 2025-08-21 21:46:26 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 82,372 KB |
実行使用メモリ | 519,364 KB |
最終ジャッジ日時 | 2025-08-21 21:47:02 |
合計ジャッジ時間 | 35,430 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 |
other | AC * 7 TLE * 4 MLE * 1 |
ソースコード
from math import comb def solve(N): cnt = 0 tmp = 0 d = 2 i = 0 while N > cnt + tmp: cnt += tmp tmp = 0 d += 1 for i in range(d//3): tmp += comb(d - 1,d - 3 * (i + 1)) t = N - cnt - 1 X = ["3","5"] Y = [] for j in range(1 << (d-1)): tmp = [] if (j.bit_count() + 1) % 3 == 0: for i in range(d-1): tmp.append(X[j&1]) j >>= 1 Y.append("".join(tmp[::-1]+["5"])) Y.sort() return Y[t] print(solve(int(input())))