QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#662257 | #9248. An Easy Math Problem | 123BVN | WA | 0ms | 3580kb | C++23 | 880b | 2024-10-20 22:18:39 | 2024-10-20 22:18:39 |
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:18:39]
- Submitted
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
map<int, int>mp;
void solve() {
int n;
cin >> 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 < 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[n] = 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: 0
Wrong Answer
time: 0ms
memory: 3580kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
1 1 2 3 2 5 2 4 3 5
result:
wrong answer 2nd lines differ - expected: '2', found: '1'