[GESP202409六级] 小杨和整数拆分
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目背景
2024 年 9 月 GESP C++ 六级编程第 1 题
题目描述
⼩杨有⼀个正整数 ,⼩杨想将它拆分成若⼲完全平⽅数的和,同时⼩杨希望拆分的数量越少越好。
⼩杨请你编写程序计算出总和为 的完全平⽅数的最少数量。
输入格式
第⼀⾏包含⼀个正整数 ,含义如题⾯所⽰。
输出格式
输出⼀个整数,代表总和为 的完全平⽅数的最少数量。
样例1
18
2
样例解释
,其中最少需要 个完全平⽅数。
数据范围
| 子任务编号 | 数据点占比 | |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | 
对于全部数据,保证有 。
GESP六级编程题练习
- Status
 - Done
 - Problem
 - 10
 - Open Since
 - 2025-3-9 4:00
 - Deadline
 - 2025-3-22 23:59
 - Extension
 - 24 hour(s)