結果
問題 |
No.294 SuperFizzBuzz
|
ユーザー |
![]() |
提出日時 | 2015-10-24 21:14:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 885 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 82,244 KB |
実行使用メモリ | 83,464 KB |
最終ジャッジ日時 | 2024-09-13 08:26:33 |
合計ジャッジ時間 | 6,721 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 TLE * 1 |
other | -- * 12 |
ソースコード
# coding:utf-8 import sys # from itertools import product N = int(input()) count = 0 ume = [0, 0, 0, 1, 4, 10, 21, 42, 84, 169, 340, 682, 1365, 2730, 5460, 10921, 21844, 43690, 87381, 174762, 349524, 699049, 1398100, 2796202, 4462868] if N in ume: print(ume.index(N)) sys.exit() else: for u in range(len(ume)): # print(N, ume[u]) if N<ume[u]: i = u count = ume[u-1] break else: i = 24 count = ume[-1] for j in range(10000000000000): a = bin(j)[2:] if len(a)>i+1: break a = '0'*(i+1-len(a))+a n = a.replace('0', '3').replace('1', '5') x = ''.join(n) x = int(x) # print(x) if x%15==0: count += 1 if count==N: print(x) sys.exit() print(count, x)