之前绝对做过几乎一模一样的题,现在做竟然忘了.
code:
#include <bits/stdc++.h> #define ll long long #define setIO(s) freopen(s".in","r",stdin) using namespace std; ll n,ans=1; int main() { // setIO("input"); ll i,j; scanf("%lld",&n); for(i=2;i*i<=n;++i) { if(n%i==0) { ll sum=0; while(n%i==0) ++sum,n/=i; ans*=2*sum+1; } } if(n>1) ans*=3; printf("%lld ",(ans+1)/2); return 0; }