結果

問題 No.2479 Sum of Squares
ユーザー tassei903tassei903
提出日時 2023-09-22 21:28:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 71,456 KB
最終ジャッジ日時 2023-09-22 21:28:59
合計ジャッジ時間 4,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,296 KB
testcase_01 AC 72 ms
71,404 KB
testcase_02 AC 72 ms
71,168 KB
testcase_03 AC 73 ms
71,048 KB
testcase_04 AC 71 ms
71,248 KB
testcase_05 AC 73 ms
71,328 KB
testcase_06 AC 73 ms
71,172 KB
testcase_07 AC 72 ms
71,212 KB
testcase_08 AC 73 ms
71,452 KB
testcase_09 AC 73 ms
71,256 KB
testcase_10 AC 73 ms
71,456 KB
testcase_11 AC 73 ms
71,180 KB
testcase_12 AC 75 ms
71,440 KB
testcase_13 AC 74 ms
71,280 KB
testcase_14 AC 74 ms
71,256 KB
testcase_15 AC 74 ms
71,248 KB
testcase_16 AC 74 ms
71,044 KB
testcase_17 AC 72 ms
71,268 KB
testcase_18 AC 73 ms
71,212 KB
testcase_19 AC 73 ms
71,172 KB
testcase_20 AC 74 ms
71,212 KB
testcase_21 AC 73 ms
71,296 KB
testcase_22 AC 71 ms
71,196 KB
testcase_23 AC 71 ms
71,092 KB
testcase_24 AC 72 ms
71,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n = ni()

a = []
for i in range(15):
    if n == 0:
        break
    ok = 0
    ng = 10**18
    while ng-ok>1:
        d = (ok+ng)>>1
        if d*d <= n:
            ok = d
        else:
            ng = d
    a.append(ok**2)
    n -= ok*ok
print(len(a))
print(*a)
0