Cod sursa(job #1105659)

Utilizator thewildnathNathan Wildenberg thewildnath Data 11 februarie 2014 22:57:09
Problema Regiuni Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<stdio.h>

int fx[102],fy[102];

int main()
{
    //freopen("date.in","r",stdin);
    int n,i,x,y,solx=0,soly=0,sol=0;
    scanf("%d",&n);
    for(i=1;i<=n;++i)
    {
        scanf("%d%d",&x,&y);
        fx[x]=1;
        fy[y]=1;
    }

    for(i=0;i<=100;++i)
    {
        if(fx[i])
            ++solx;
        if(fy[i])
            ++soly;
    }

    if(solx<=soly)
        sol=solx;
    else
        sol=soly;

    printf("%d\n",sol);

    return 0;
}