Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("magic3.in");
- ofstream fout("magic3.out");
- int nrdiv(int n)
- {
- int k;
- if(n==1) return 1;
- k=2;
- for(int d=2;d*d<=n;d++){
- if(n%d==0){
- k=k+2;
- }
- if(d*d==n){
- k--;
- }
- }
- return k;
- }
- int main()
- {
- int n,a[1001],nrmindiv=1e9,x,S=0;
- fin>>n;
- for(int i=1;i<=n;i++){
- fin>>a[i];
- x=nrdiv(a[i]);
- if(x<nrmindiv){
- S=1;
- nrmindiv=x;
- }
- else if (x==nrmindiv) S++;
- }
- fout<<S;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement