結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,840 KB
testcase_01 AC 14 ms
7,828 KB
testcase_02 AC 14 ms
7,768 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,800 KB
testcase_05 AC 14 ms
7,768 KB
testcase_06 AC 14 ms
7,768 KB
testcase_07 AC 14 ms
7,872 KB
testcase_08 AC 15 ms
7,768 KB
testcase_09 AC 14 ms
7,932 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 14 ms
7,808 KB
testcase_12 AC 14 ms
7,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())
one=[0,0]
for i in range(2,31):
  one.append(i*(i-1)//2)
zero=[1]
for i in range(1,29):
  zero.append(2**i)

ans0=0
ans1=0

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