結果
問題 | No.2479 Sum of Squares |
ユーザー |
|
提出日時 | 2023-09-22 22:21:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 85 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-08 13:06:06 |
合計ジャッジ時間 | 2,279 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 2 |
ソースコード
import sys def main(): input = lambda: sys.stdin.readline()[:-1] S = int(input()) ans, n = [], S while n > 1: x = int(n**0.5) ** 2 ans.append(x) n -= x if sum(ans) != S: ans.append(1) if sum(ans) != S: ans.append(1) print(len(ans)) print(*ans) if not __debug__: f = open(sys.argv[1], "r") sys.stdin = f main()