Cod sursa(job #1032136)

Utilizator Dragan_ValentinDragan Valentin Dragan_Valentin Data 15 noiembrie 2013 18:57:47
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda FMI No Stress 4 Marime 0.48 kb
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstdio>

using namespace std;

int main()
{
    long long v[300000];
    long long i,n,x,j;
    long long nr=0;
    ifstream f("dtcsu.in");
    for (i=0; i<276997; i++) {
        f>>v[i];
    }
    f>>n;
    for (i=0; i<n; i++) {
        f>>x;
        for (j=0; j<276997 && v[j]<=x; j++)
            if (v[j]==x) ++nr;
    }

    ofstream g("dtcsu.out");
    g<<nr<<'\n';


    return 0;
}