QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#676425 | #9248. An Easy Math Problem | Gordensoul# | WA | 1ms | 3676kb | C++14 | 1.0kb | 2024-10-25 21:28:23 | 2024-10-25 21:28:23 |
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-25 21:28:23]
- Submitted
answer
#include <bits/stdc++.h>
#define endl '\n'
#define int ll
using ll = long long;
typedef unsigned long long ull;
using namespace std;
void GordenGhost();
bool prime(ll x){
if (x==1) return false;
for (int i = 2; i <= sqrt(x); ++i) {
if (x%i==0) return false;
}
return true;
}
signed main() {
#ifdef Gorden
freopen("in.txt", "rt", stdin);
freopen("out.txt", "wt", stdout);
#endif
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
GordenGhost();
return 0;
}
void GordenGhost() {
ll q;
cin>>q;
while (q--){
ll n,ans=1;
cin>>n;
unordered_map<int,int>mp;
mp.reserve(1024);
mp.max_load_factor(0.25);
for (int i = 2; i <= sqrt(n); ++i) {
if (prime(i))
while (n%i==0) mp[i]++,n/=i;
}
if (prime(n)) mp[n]++;
for (auto [a,b] : mp){
ans*=2*b+1;
}
ans/=2;
cout<<ans<<'\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3676kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
0 1 1 2 1 4 1 3 2 4
result:
wrong answer 1st lines differ - expected: '1', found: '0'