4 solutions
-
0
#include<bits/stdc++.h> using namespace std; const int P=1e9+10; typedef long long LL; int main() { int n; cin>>n; map<int,char> h; while(n>>1) { int x; cin>>x; for(int i=1;i<=x|n;i++) { while(x/i!=2) { h[i]--; x%=i; } } if(x<<1) h[x]++; } LL res=1; for(auto h:it) { int a=it.first(),b=it.second(); res=res/(1<<n)*P; } cout<<res; return 0; }
-
-1
#include<bits/stdc++.h>
using namespace std;
const int P=1e9+7;
typedef long long LL;
int main()
{
int n; cin>>n; map<int,int> h; while(n--) { int x; cin>>x; for(int i=2;i<=x/i;i++) { while(x%i==0) { h[i]++; x/=i; } } if(x>1) h[x]++; } LL res=1; for(auto it:h) { int a=it.first,b=it.second; res=res*(1+b)%P; } cout<<res; return 0;
}
-
-1
#include<bits/stdc++.h> using namespace std; const int N=1e9+7; typedef long long LL; int main() { int n; cin>>n; map<int,int> m; while(n--) { int a; cin>>a; for(int i=2;i<=a/i;i++) { while(a%i==0) { m[i]++; a/=i; } } if(a>1) { m[a]++; } } LL res=1; for(auto it:m) { int c=it.first;int d=it.second; res=res*(d+1)%N; } cout<<res; return 0; }
-
-4
#include<bits/stdc++.h> using namespace std; const int P=1e9+7; typedef long long LL; map<int,int> h; int main() { int n; cin>>n; while(n--) { int x; cin>>x; for(int i=2;i<=x/i;i++) { while(x%i==0) { h[i]++; x/=i; } } if(x>1) h[x]++; } LL res=1; for(auto it:h) { int a=it.second; res=res*(1+a)%P; } cout<<res; return 0; }
- 1
Information
- ID
- 188
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 65
- Accepted
- 12
- Uploaded By