Cod sursa(job #1030695)
Utilizator | FMI - ALexandru Mihai the_snyper06 | Data | 15 noiembrie 2013 16:48:02 |
---|---|---|---|
Problema | Dtcsu | Scor | 20 |
Compilator | cpp | Status | done |
Runda | FMI No Stress 4 | Marime | 0.52 kb |
#include <cstdio>
using namespace std;
int n, sum;
int main() {
int i;
long long x;
freopen ("dtcsu.in", "r", stdin), freopen ("dtcsu.out", "w", stdout);
for (i = 0; i < 276997; i++)
scanf ("%lld", &x);
scanf ("%d", &n);
for (i = 0; i < n; i++) {
scanf ("%lld", &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;
if (x == 1)
sum += 1;
}
printf ("%d\n", sum);
return 0;
}