QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#202583#872. Joyful NumbersisaunoyaWA 1ms3496kbC++23511b2023-10-06 12:17:462023-10-06 12:17:47

Judging History

你现在查看的是最新测评结果

  • [2023-10-06 12:17:47]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3496kb
  • [2023-10-06 12:17:46]
  • 提交

answer

#include<iostream>
#include<cstdio>
using namespace std;
int k;
int count(__int128 n)
{
  int cnt=0;
  for(int i=2;(__int128)i*i<=n;i++)
    if(n%i==0)
    {
      cnt++;
      while(n%i==0) n/=i;
    }
  cnt++;
  return cnt;
}
void solve()
{
  cin>>k;
  __int128 n=(__int128)(k*10ll+5)*(k*10ll+5)/100;
  cout<<count(n)<<"\n";
  return;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr),cout.tie(nullptr);
  int T;
  cin>>T;
  while(T--)
    solve();
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3496kb

input:

2
1
4

output:

1
2

result:

ok 2 number(s): "1 2"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

1
1000000000

output:

7

result:

ok 1 number(s): "7"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3424kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
2
3
3
2
3
3
3

result:

wrong answer 8th numbers differ - expected: '2', found: '3'