結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-01-13 08:59:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 348 bytes |
| コンパイル時間 | 584 ms |
| コンパイル使用メモリ | 82,104 KB |
| 実行使用メモリ | 52,444 KB |
| 最終ジャッジ日時 | 2024-12-24 03:19:13 |
| 合計ジャッジ時間 | 2,122 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 1 |
ソースコード
K = int(input())
two = [1] * 31
for i in range(1, 31):
two[i] = two[i - 1] * 2
ans = []
for i in range(2, 31):
q, r = divmod(K, (i * (i - 1)//2))
if r:
continue
if q not in two:
continue
ind = two.index(q)
if ind + i > 30:
continue
ans = [0] * ind + [1] * i
break
print(len(ans))
print(*ans)
rlangevin