Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
526 B
4
Indexable
#include<iostream>


using namespace std;
int fr1[21] = {}, fr2[21] = {};


int main()
{ int v[50][50], n, m, i, j, ok=0;

    cin>>m>>n;

    for(i=1;i<=m;i++) {

        for(j=1;j<=n;j++) {
            cin>>v[i][j];

        if(j==1)
            fr1[v[i][j]++]++;

        else if(j==n)
            fr2[v[i][j]]++;
    } }


    for(i=1;i<=20;i++) {

        if(fr1[i]==1 && fr2[i]==1)
        { cout<<i<<" ";
            ok=1;}


    }

    if(ok==0) cout<<"NU EXISTA";

    return 0;
}