QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#662329 | #9248. An Easy Math Problem | 123BVN | WA | 0ms | 3880kb | C++23 | 903b | 2024-10-20 22:59:28 | 2024-10-20 22:59:28 |
Judging History
This is the latest submission verdict.
- [2024-10-31 22:36:43]
- hack成功,自动添加数据
- (/hack/1098)
- [2024-10-31 22:13:58]
- hack成功,自动添加数据
- (/hack/1096)
- [2024-10-31 22:00:43]
- hack成功,自动添加数据
- (/hack/1095)
- [2024-10-20 22:59:28]
- Submitted
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
map<int, int>mp;
void solve() {
int n,m;
cin >> n;
m = n;
if (mp[n]) {
cout << mp[n] << endl;
return;
}
vector<int>v;
for (int i = 2; i <= n / i; i++) {
int cnt = 0;
while (n % i == 0) {
cnt++;
n /= i;
}
v.push_back(cnt);
}
if (n > 1)v.push_back(1);
n = 2;
for (int i = 1; i < v.size(); i++) {
n *= 2;
}
int ans = 1;
for (int i = 0; i < min(5000ll,n); i++) {
int x = i;
int pos1 = 1, pos2 = 1;
int cnt = 0;
for (int j = 0; j < v.size(); j++) {
if (x % 2)pos1 *= v[j];
else pos2 *= (v[j] + 1);
x /= 2;
}
ans += pos1 * pos2;
}
mp[m] = ans / 2;
cout << ans / 2 << "\n";
}
signed main() {
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int _ = 1;
cin >> _;
while (_--) {
solve();
}//ut << _<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3880kb
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: 0ms
memory: 3588kb
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:
5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 5832 ...
result:
wrong answer 1st lines differ - expected: '29525', found: '5832'