Cod sursa(job #1032365)

Utilizator MihaiBunBunget Mihai MihaiBun Data 15 noiembrie 2013 19:20:17
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda FMI No Stress 4 Marime 0.6 kb
#include <cstdio>

using namespace std;
int y;
long i,q,nr;
long long x;
int main()
{
    freopen("dtcsu.in","r",stdin);
    freopen("dtcsu.out","w",stdout);
    for (i=1;i<=276997;i++)
    {
      scanf("%d",&y);
    };
    scanf("%ld",&q);
    nr=0;
    for (i=1;i<=q;i++)
    {
       scanf("%ld",&x);
       while (x%2210==0)x=x/2210;
       while (x%770==0)x=x/770;
       while (x%2==0)x=x/2;
       while (x%3==0)x=x/3;
       while (x%5==0)x=x/5;
       while (x%7==0)x=x/7;
       while (x%11==0)x=x/11;
       if (x==1)nr++;
    };
    printf("%ld",nr);
    return 0;
}