4436: Easy Math Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.scu.edu.cn/soj/problem.action?id=4436 Description Given n integers a1,a2,…,an, check if the sum of their square root a1+a2+…+an is a integer. Input The input consists of multiple…
A. Easy Math Time Limit: 2000ms Memory Limit: 65536KB Given n integers a1,a2,-,an, check if the sum of their square root a1−−√+a2−−√+⋯+an−−√ is a integer. Input The input consists of multiple tests. For each test: The first line contains 1 integer n…
代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 20000000; bool check[N+20]; int prime[N+20], mu[N+20], tot; void mobius() { memset(check, 0, sizeof(check)); mu[1] = 1; tot = 0; for(int i = 2; i <= N; ++i) { if…