結果
| 問題 |
No.294 SuperFizzBuzz
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-09 19:47:19 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 768 bytes |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 76,936 KB |
| 実行使用メモリ | 182,880 KB |
| 最終ジャッジ日時 | 2024-09-15 05:54:41 |
| 合計ジャッジ時間 | 7,262 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 TLE * 1 |
| other | -- * 12 |
ソースコード
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll
def comb(n, r):
res = 1
for i in xrange(r):
res *= n - i
for i in xrange(1, r + 1):
res /= i
return res
ans = 0
N = int(raw_input())
#3は5n個、5は3m個。1桁目は必ず5
for k in xrange(3, 26):
cnt = 0
f = []
for i in xrange(3, k + 1, 3):
j = k - i
cnt += comb(j + i - 1, i - 1)
f.append(i)
if N > cnt:
N -= cnt
else:
x = -1
while N:
x += 2
b = bin(x)[2:].zfill(k)
if b.count("1") in f:
N -= 1
ans = bin(x)[2:].replace("0", "3").replace("1", "5")
break
if ans > 0: break
print ans