QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#706860#9248. An Easy Math ProblemOkuchiri#WA 34ms3780kbC++201012b2024-11-03 13:43:212024-11-03 13:43:21

Judging History

This is the latest submission verdict.

  • [2024-11-03 13:43:21]
  • Judged
  • Verdict: WA
  • Time: 34ms
  • Memory: 3780kb
  • [2024-11-03 13:43:21]
  • Submitted

answer

#include<bits/stdc++.h>
#define ll int
#define mod 998244353
#define For(i, a, n) for(int i = a; i <= n; i++)
using namespace std;
const int maxn = 1e5 + 5;
ll n, ans;
bool vis[maxn];
vector<ll> v;
void init()
{
    int maxx = 1e5;
    For(i, 2, maxx)
    {
        if(vis[i]) continue;
        v.push_back(i);
        for(int j = i + i; j <= maxx; j += i)
        {
            vis[j] = true;
        }
    }
}
void work()
{
    cin >> n;
    ans = 1ll;
    vector<ll> res;
    for(auto x:v)
    {
        ll cnt = 0;
        while(!(n % x))
        {
            n /= x;
            cnt++;
        }
        if(cnt) res.push_back(cnt);
    }
    if(n > 1) res.push_back(1ll);
    for(auto x:res)
    {
        ans *= (x * 2ll + 1ll);
    }
    ans /= 2;
    ans++;
    cout << ans << "\n";
    return;
}
signed main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int T=1;
    cin>>T;
    init();
    while(T--)
    {
        work();
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3772kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
3
2
5
2
4
3
5

result:

ok 10 lines

Test #2:

score: -100
Wrong Answer
time: 34ms
memory: 3780kb

input:

2000
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
646969323...

output:

2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

result:

wrong answer 1st lines differ - expected: '29525', found: '2'