Cod sursa(job #1912547)

Utilizator andreizaicescuAndrei Zaicescu andreizaicescu Data 8 martie 2017 09:33:18
Problema Componente tare conexe Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.43 kb
#include <fstream>

using namespace std;
ifstream f("ctc.in");
ofstream g("ctc.out");
struct el{int nod; int urm;};
el a[200001];
int l[100001],n,k,i,j,v1[100001],v2[100001],x,y,m,;
bool viz[100001];
void ad(int x, int y)
{
    k++;
    a[k].nod=y;
    a[k].urm=l[x];
    l[x]=k;
}
int main()
{
    f>>n>>m;
    for(i=1;i<=m;i++)
    {
        f>>x>>y;
        ad(x,y);
    }
    g<<sizeof a;
    return 0;
}