結果

問題 No.294 SuperFizzBuzz
ユーザー NoNo
提出日時 2018-01-28 22:44:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 668 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 7,832 KB
最終ジャッジ日時 2023-08-28 14:39:01
合計ジャッジ時間 6,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,756 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def com(n, r):
    if n == 0 or r == 0: return 1
    return com(n, r - 1) * (n - r + 1) / r

def cou(b):
    return bin(b).count("1")

n = int(input())
cnt = 0
c = 2
r2 = 0
while 0 == 0:
    e = (c + 1) % 3
    r2 = 0
    while e < c:
        r = com(c,e)
        r2 += r
        cnt += r
        e+= 3
    c += 1
    if cnt >= n:
        break

n2 = int(n - (cnt - r2))

b = 2
cnt2 = 0
while cnt2 != n2:
    b += 1
    t = cou(b) 
    if  t == 2 or t == 5 or t == 8 or t == 11 or t == 14 or t == 17 or t == 20 or t == 23:
        cnt2 += 1
ans = str(bin(b)).replace("0b","").replace("1","5").replace("0","3") + "5"

while len(ans) < c:
    ans = "3" + ans

print(ans)
0