QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#706860 | #9248. An Easy Math Problem | Okuchiri# | WA | 34ms | 3780kb | C++20 | 1012b | 2024-11-03 13:43:21 | 2024-11-03 13:43:21 |
Judging History
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'