結果

問題 No.2479 Sum of Squares
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-09-22 23:23:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 176 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 71,628 KB
最終ジャッジ日時 2023-09-22 23:23:32
合計ジャッジ時間 3,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,204 KB
testcase_01 AC 68 ms
71,164 KB
testcase_02 AC 70 ms
71,284 KB
testcase_03 AC 71 ms
71,304 KB
testcase_04 AC 69 ms
71,220 KB
testcase_05 AC 70 ms
71,328 KB
testcase_06 AC 70 ms
71,304 KB
testcase_07 AC 69 ms
71,132 KB
testcase_08 AC 70 ms
70,972 KB
testcase_09 AC 69 ms
71,280 KB
testcase_10 AC 70 ms
71,164 KB
testcase_11 AC 70 ms
71,388 KB
testcase_12 AC 95 ms
71,496 KB
testcase_13 AC 70 ms
71,236 KB
testcase_14 AC 70 ms
71,184 KB
testcase_15 AC 70 ms
71,168 KB
testcase_16 AC 70 ms
71,392 KB
testcase_17 AC 69 ms
71,324 KB
testcase_18 AC 70 ms
71,372 KB
testcase_19 AC 68 ms
71,136 KB
testcase_20 AC 68 ms
71,208 KB
testcase_21 AC 68 ms
71,436 KB
testcase_22 AC 70 ms
71,224 KB
testcase_23 AC 68 ms
71,628 KB
testcase_24 AC 69 ms
71,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=int(input())
a=[]
while s>0:
  ok=0
  ng=s+1
  while ng-ok>1:
    m=(ok+ng)//2
    if m**2<=s:
      ok=m
    else:
      ng=m
  a+=[ok**2]
  s-=ok**2
print(len(a))
print(*a)
0