結果

問題 No.688 E869120 and Constructing Array 2
ユーザー kobaya0514kobaya0514
提出日時 2018-05-18 22:48:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 286 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-09-21 19:59:19
合計ジャッジ時間 1,976 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,812 KB
testcase_01 RE -
testcase_02 AC 16 ms
7,916 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,848 KB
testcase_05 AC 16 ms
7,776 KB
testcase_06 AC 16 ms
7,780 KB
testcase_07 RE -
testcase_08 AC 16 ms
7,840 KB
testcase_09 WA -
testcase_10 AC 16 ms
7,832 KB
testcase_11 AC 16 ms
7,808 KB
testcase_12 AC 15 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())
one=[0,0]
for i in range(2,31):
  one.append(i*(i-1)//2)
zero=[0]
for i in range(1,29):
  zero.append(2**i)
for i in range(len(one)):
  for j in range(len(zero)):
    if one[i]*zero[j]==K:
      ans0,ans1=j,i
      break
ans=[0]*ans0+[1]*ans1
print(len(ans))
print(*ans)
0