49,440
社区成员




第一题:
#include <iostream>
using namespace std;
typedef long long LL;
int main()
{
int res = 0;
int a = 1, b = 1;
LL n = 202202011200;
for (int i = 3; i <= n; i ++ )
{
int c = a + b;
a = b;
b = c;
if (a % 10 == 7) res ++ ;
}
cout << res << endl;
return 0;
}
第二题:直接判断素数,一直算
#include <iostream>
using namespace std;
int main()
{
// 请在此输入您的代码
cout<<342963;
return 0;
}
第三题:
#include <iostream>
using namespace std;
typedef long long LL;
const int N = 1e7 + 10;
LL primes[N], cnt = 0;
bool st[N];
void get_primes(LL n)
{
for (int i = 2; i <= n; i ++ )
{
if (!st[i]) primes[cnt ++ ] = i;
for (int j = 0; primes[j] <= n / i; j ++ )
{
st[primes[j] * i] = true;
if (i % primes[j] == 0) break;
}
}
}
int main()
{
get_primes(N);
LL n;
LL cnt = 1L;
scanf("%lld", &n);
for (int i = 0; i < cnt; i ++ )
if (n % primes[i] == 0)
cnt ++ ;
cout << cnt << endl;
return 0;
}