PE

中文翻译

最喜欢做这种很有意思的数学题了虽然数学很垃圾

但是这个网站的提交方式好鬼畜啊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;
}
/*
*/
T3

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-11-07
  • 2021-12-13
猜你喜欢
  • 2022-02-10
  • 2021-05-30
  • 2021-06-30
  • 2021-10-11
相关资源
相似解决方案