PDA

View Full Version : [PBINFO] Problema #777



~Wolf~
09-11-2020, 12:48 PM
Link site: pbinfo (<b>You have to register to ba able to see this link</b>)
Link problema: cntcoloane (<b>You have to register to ba able to see this link</b>)

#include <iostream>
using namespace std;
int main()
{
unsigned int n,m,i,j,ok=1,contor=0;
cin>>n>>m;
unsigned int matrice[n][m];
for(i=0;i<n;i++)
for(j=0;j<m;j++)
cin>>matrice[i][j];
for(i=0;i<m;i++)
{
ok=1;
for(j=0;j<n;j++)
{
for(unsigned int k=1;k<n;k++)
{
if(matrice[j][i]==matrice[k][i] && j!=k)
{
ok=0;
break;
}
}
}
if(ok==1)
contor++;
}
cout<<contor;
return 0;
}