OpenCV
Time Limit: 1000MS | Memory Limit: 65535KB |
Submissions: 151 | Accepted: 35 |
Sample Input
4 4
3
255 0 0 255
223 221 220 190
10 11 12 13
0 0 0 0
255 1 1 255
245 221 220 100
11 11 0 13
1 1 1 1
255 0 0 255
245 221 220 100
11 11 0 13
1 1 1 1
Sample Output
#include<iostream>
using namespace std;
int main()
{
int n,m,z,i,j,k,l,a[256],b[100],num,t;
cin>>n>>m;
cin>>z;
for(i=0;i<z;i++)
{
num=0;
for(l=0;l<=256;l++)
a[l]=0;
for(j=0;j<m*n;j++)
{
cin>>t;
a[t]++;
}
for(k=0;k<=256;k++)
num+=a[k]!=0;
b[i]=num;
}
int max=b[0];
for(i=1;i<z;i++)
if(b[i]>=max)
max=b[i];
cout<<max<<endl;
}