結果
| 問題 | No.688 E869120 and Constructing Array 2 |
| コンテスト | |
| ユーザー |
kerotono
|
| 提出日時 | 2018-05-18 23:00:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 682 bytes |
| 記録 | |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 17,280 KB |
| 最終ジャッジ日時 | 2024-07-07 13:32:53 |
| 合計ジャッジ時間 | 4,418 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | WA * 9 TLE * 1 |
ソースコード
#!python
# -*- coding: utf-8 -*-
def main():
bit_T = []
i = 0
while True:
a = 2**i
if not (a <= 1000000000):
break
bit_T.append(a)
i += 1
K = int(input())
if K == 0:
print(1)
print("0")
elif K == 1:
print(2)
print("1 1")
one_num = 2
i = 1
n = 1
s = '1'
while True:
for _, b in enumerate(bit_T):
if b * n == K:
s += ' 0' * _
print(len(s) // 2 + 1)
print(s)
return
i += 1
n += i
one_num += 1
s += ' 1'
if __name__ == '__main__':
main()
kerotono