题意:
给以数
n
n
n,求
∑
i
2
,
1
≤
i
≤
n
∑i^2,1≤i≤n
∑i2,1≤i≤n是否是一个完全平方数。
思路;
结论题,也可以打表看出来,只有1和24满足条件。
不过也可以直接用平方和公式写。
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int maxn = 5000 + 7;
int main() {
int T;scanf("%d",&T);
while(T--) {
int n;scanf("%d",&n);
if(n == 1 || n == 24) {
printf("Fake news!\n");
} else {
printf("Nobody knows it better than me!\n");
}
}
}