結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-12 16:11:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 398 bytes |
| コンパイル時間 | 317 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 53,804 KB |
| 最終ジャッジ日時 | 2024-09-16 23:32:31 |
| 合計ジャッジ時間 | 1,499 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 1 |
ソースコード
K = int(input())
if K == 0:
print(0)
exit()
for i in range(2,10**5+1):
if K < (i*(i-1) // 2):
break
if K % (i*(i-1) // 2) == 0:
c = K // (i*(i-1) // 2)
if bin(c).count('1') == 1:
n1 = i
n0 = 0
while c > 1:
c //= 2
n0 += 1
break
ans = [1]*n1 + [0]*n0
print(len(ans))
print(*ans)