結果

問題 No.688 E869120 and Constructing Array 2
ユーザー takakintakakin
提出日時 2020-05-28 22:17:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 489 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 13:00:21
合計ジャッジ時間 1,780 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,624 KB
testcase_01 RE -
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 33 ms
10,624 KB
testcase_06 AC 35 ms
10,624 KB
testcase_07 RE -
testcase_08 AC 33 ms
10,880 KB
testcase_09 RE -
testcase_10 AC 30 ms
10,624 KB
testcase_11 AC 30 ms
10,880 KB
testcase_12 AC 29 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
pf={}
for i in range(2,int(n**0.5)+1):
  while n%i==0:
    pf[i]=pf.get(i,0)+1
    n//=i
if n>1:
  pf[n]=1
if len(pf.keys())==1:
  ans1=2
  ans2=pf[2]
else:
  m=1
  ct2=pf[2]
  for p in pf.keys():
    if p!=2:
      m*=p**pf[p]
  for i in range(ct2+1):
    if int(m**0.5)*(int(m**0.5)+1)==m:
      ans1=int(m**0.5)+1
      ans2=ct2-i+1
      break
    else:
      m*=2

Ans=[1]*ans1+[0]*ans2
print(len(Ans))
print(*Ans)
0