10110
让人无语的蛋疼题,我本来是按照求素数那样想求出有多少个因子,再判断其奇偶,但竟然超时。。
也不知道他们有多少个case。。。后来一想,不需要求银子个数,只需判是否开方为整数即可判断其奇偶性,然后就过了
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
long long ans, n, t;
int main() {
freopen("a.txt", "r", stdin);
while(scanf("%lld", &n)&&n)
{
t = (long long)(sqrt(n));
if(t*t == n)
{
printf("yes\n");
}
else printf("no\n");
}
return 0;
}

浙公网安备 33010602011771号