最喜欢做这种很有意思的数学题了虽然数学很垃圾
但是这个网站的提交方式好鬼畜啊qwq
1.Multiples of 3 and 5
直接枚举
2.Even Fibonacci numbers
直接枚举
3.Largest prime factor
$\sqrt(n)$枚举
#include<cstdio> #include<vector> #include<set> #include<algorithm> #define sit #define LL long long using namespace std; const int MAXN = 1e6 + 10; inline int read() { char c = getchar(); LL x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x * f; } LL ans = 600851475143; int main() { LL out = 0; for(LL i = 2; i * i <= ans; i++) { if(ans % i == 0) { out = max(out, i); while(ans % i == 0) ans /= i; } } printf("%I64d", max(out, ans)); return 0; } /* */