結果

問題 No.294 SuperFizzBuzz
ユーザー titiatitia
提出日時 2022-10-17 05:42:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,589 ms / 5,000 ms
コード長 635 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 77,400 KB
最終ジャッジ日時 2023-09-10 06:32:32
合計ジャッジ時間 15,854 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,164 KB
testcase_01 AC 69 ms
71,668 KB
testcase_02 AC 2,535 ms
77,160 KB
testcase_03 AC 70 ms
71,532 KB
testcase_04 AC 68 ms
71,396 KB
testcase_05 AC 69 ms
71,452 KB
testcase_06 AC 79 ms
76,736 KB
testcase_07 AC 80 ms
76,632 KB
testcase_08 AC 187 ms
77,160 KB
testcase_09 AC 1,599 ms
77,400 KB
testcase_10 AC 69 ms
71,688 KB
testcase_11 AC 2,136 ms
77,152 KB
testcase_12 AC 2,280 ms
77,212 KB
testcase_13 AC 2,407 ms
77,268 KB
testcase_14 AC 2,589 ms
77,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
count=0

A=[0,1,4,10,21,42,84,169,340,682,1365,2730,5460,10921,21844,43690,87381,174762,349524,699049,1398100,2796202,5592405]


ss=25
count=A[-1]

for i in range(len(A)):
    if A[i]>=N:
        ss=i-1+3
        count=A[i-1]
        break


for j in range(1<<ss):
    if j%2==0:
        continue
    c=0
    for k in range(ss):
        if j & (1<<k) !=0:
            c+=1
        
    if c%3!=0:
        continue

    count+=1
    
    if count==N:
        y=""
        for k in bin(j)[2:].zfill(ss):
            if k=="0":
                y+="3"
            else:
                y+="5"
        print(y)
        break
0