結果
問題 | No.2479 Sum of Squares |
ユーザー |
|
提出日時 | 2024-05-04 20:40:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 86 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-26 10:54:46 |
合計ジャッジ時間 | 1,745 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
import mathdef intsqrt(n):sqnf=math.sqrt(n)dig=math.ceil(math.log10(sqnf))sq=0for k in reversed(range(0,dig+1)):for l in range(0,10):sq+=10**kif sq*sq==n:breakif sq*sq>n:sq-=10**kbreakreturn sqS=int(input())ans=[]while S:t=intsqrt(S)t*=tans.append(t)S-=tprint(len(ans))print(*ans)