Cod sursa(job #1582889)
| Utilizator | Data | 28 ianuarie 2016 16:37:37 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <bits/stdc++.h>
#define int64 long long
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
bool solve(int64 x)
{
while(x%2==0)x/=2;
while(x%3==0)x/=3;
while(x%5==0)x/=5;
while(x%7==0)x/=7;
while(x%11==0)x/=11;
return x==1;
}
int main() {
int64 cnt=0,n;
string s;
for(int i=1;i<=276997;i++)
in>>s;
for(in>>n;n;n--)
{
int64 x;
in>>x;
if(solve(x))
{
//cout<<x<<'\n';
cnt++;
}
}
out<<cnt<<'\n';
return 0;
}
