打表后发现答案都是完全平方数,直接输出即可. #include <cstdio> #include <algorithm> using namespace std; int main() { long long n; scanf("%lld",&n); for(long long i=1;i*i<=n;++i) printf("%lld ",(long long)i*i); return 0; }…
感觉好水呀~ Code: #include <cstdio> #include <algorithm> #define N 1000005 #define setIO(s) freopen(s".in","r",stdin) using namespace std; int sum[N],vis[N],Mx[N],val[N]; int main() { int i,j,n; // setIO("input"); scan…