Cod sursa(job #1030543)

Utilizator deneoAdrian Craciun deneo Data 15 noiembrie 2013 16:32:00
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda FMI No Stress 4 Marime 0.68 kb
#include <iostream>
#include <fstream>
using namespace std;

ifstream fin("dctsu.in");
ofstream fout("dctsu.out");

int test[5] = {2, 3, 5, 7, 11};

bool is_special(long long nr) {
    for (long long i = 2; i * i <= nr; ++i) {
        if (nr % i == 0) {
            if (i > 11) return 0;
            while (nr % i == 0)
                nr /= i;
        }
    }
    if (nr > 11) return 0;
    return 1;
}

int main() {
    int rez = 0;
    for (int i = 1; i <= 276997; ++i)
        fin >> rez;
    rez = 0;
    int q; fin >>q;

    for (int i = 1; i <= q; ++i) {
        int a; fin >> a;
        if (is_special(a)) ++rez;
    }

    fout << rez;
    return 0;
}