Untitled
raw download clone
TEXT
views 35
,
size 457 b
#include <iostream>

using namespace std;

int n,m,a[101][101],x,y,v[101],c;
int main()
{
    cin>>n>>m;
    for (int k=1;k<=m;k++)
    {
        cin>>x>>y;
        a[x][y]=1;
    }
    for (int i=1;i<=n;i++)
    {
        int suma=0;
        for(int j=1;j<=n;j++)
            suma=suma+a[j][i];
        if(suma==0) v[++c]=i;
    }
    if(c==0) cout<<"NU EXISTA";
    for (int i=1;i<=c;i++)
        cout<<v[i]<<" ";
    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.