QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#556764 | #9248. An Easy Math Problem | ucup-team3712# | TL | 0ms | 3828kb | C++20 | 1.4kb | 2024-09-10 20:43:30 | 2024-09-10 20:43:30 |
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-09-10 20:43:30]
- Submitted
answer
//created: 2024-09-10 20:15:03
// #define SKADI
#if defined(YUANSHEN)
#include<D:/Tovi/template/my_template.hpp>
#else
#include<bits/stdc++.h>
using namespace std;
#endif
#ifndef SKADI
#define dbg(...) 42
#endif
template <typename T1, typename T2> void cmin(T1 &x, const T2 &y) {
x = x < y ? x : y;
}
template <typename T1, typename T2> void cmax(T1 &x, const T2 &y) {
x = x > y ? x : y;
}
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
#define fixset(x) fixed<<setprecision(x)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
#define ALL(x) (x).begin()+1,(x).end()
const int INF = 1000000000;
const ll LNF = 1000000000000000000;
void solve()
{
ll n;
cin>>n;
vector<ll>v;
for(ll i=1;i*i<=n;i++){
if(n%i) continue;
v.push_back(i);
if(i*i==n) continue;
v.push_back(n/i);
}
sort(all(v));
// dbg(v);
// dbg(sz(v));
ll ans=0;
set<pii>st;
for(int i=0;i<sz(v);i++)
for(int j=0;j<=i;j++){
if(n%(v[i]*v[j])) continue;
ll g=__gcd(v[i],v[j]);
st.insert({v[i]/g,v[j]/g});
}
cout<<sz(st)<<'\n';
}
int main()
{
#ifndef SKADI
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
#endif
int T = 1;
cin>>T;
while(T--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3828kb
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
Time Limit Exceeded
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...