結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
Mr.Fuku
|
| 提出日時 | 2018-06-28 22:17:17 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 654 bytes |
| コンパイル時間 | 155 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2024-07-07 14:21:06 |
| 合計ジャッジ時間 | 3,331 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 9 TLE * 1 |
ソースコード
# coding: utf-8
# Your code here!
k = int(input())
lst = []
n1,n2 = 1,2
for i in range(29):
lst.append(n1*n2//2)
n1,n2 = n2,n2+1
def white(n,zero,one):
s = "0 "*zero+"1 "*one
print(n)
print(s[:-1])
def f():
zero_pattern = 2
zero_cnt = 1
while True:
yakusu = k//zero_pattern
if yakusu in lst:
one_cnt = lst.index(yakusu)+2
total_cnt =zero_cnt+one_cnt
if 30>=total_cnt:
white(total_cnt,zero_cnt,one_cnt)
return
zero_pattern *= 2
zero_cnt += 1
if k in lst:
i = lst.index(k)+2
white(i,0,i)
else:
f()
Mr.Fuku