题意: 有这样一个问题,给出一个数组,把里面的数字分组,使得每一个组里面的数两两相乘都是完全平方数. 问最少可以分成的组数k是多少. 现在一个人有一个数组,他想知道这个数组的连续子数组中,使得上面的问题答案分别为1到n的数组有多少个. 第一个样例 2 5 5 子数组有[5],[5],[5 5]三个,这三个组最少可以分别分为1 1 1组,使得每个组的任意两个数相乘都是平方数. 思路: 感谢js帮本智障debug. 首先对于一个不为0的数,如果把它的所有完全平方数的因子去掉,那么是不会影响结果的.…