結果
| 問題 |
No.294 SuperFizzBuzz
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-12-19 19:45:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 607 bytes |
| コンパイル時間 | 548 ms |
| コンパイル使用メモリ | 82,436 KB |
| 実行使用メモリ | 63,516 KB |
| 最終ジャッジ日時 | 2024-12-19 19:45:19 |
| 合計ジャッジ時間 | 2,393 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 12 |
ソースコード
M=50
comb=[[0]*M for m in range(M)]
comb[0][0]=1
for i in range(M):
for j in range(M):
if i:
comb[i][j]+=comb[i-1][j]
if j:
comb[i][j]+=comb[i][j-1]
def cnt(d,x):
retu=0
for c in range(d):
if (c*5+x+5)%3==0:
retu+=comb[d-1-c][c]
print(d,x,retu)
return retu
d=0
N=int(input())-1
while cnt(d,0)<=N:
N-=cnt(d,0)
d+=1
ans_lst=[None]*d
ans_lst[0]=5
cur=0
for i in range(d-1,0,-1):
if cnt(i,cur+3)<=N:
N-=cnt(i,cur+3)
ans_lst[i]=5
cur+=5
else:
ans_lst[i]=3
print(*ans_lst[::-1],sep="")
vwxyz