Pagini recente » Cod sursa (job #2954668) | Profil xxLLL | Cod sursa (job #1345349) | Cod sursa (job #429972) | Cod sursa (job #53758)
Cod sursa(job #53758)
#include <iostream.h>
#include<fstream.h>
int n,t,i,j,a[3500],b[3500],c[3500],max[3500],ma;
int main(){
fstream f("cutii.in",ios::in);
fstream g("cutii.out",ios::out);
f>>n>>t;
while(t>0)
{
for(i=1;i<=n;i++)
f>>a[i]>>b[i]>>c[i];
t--;
ma=0;
for(i=1;i<=n;i++)
{
max[i]=1;
for(j=1;j<=n;j++)
{
if(a[i]<a[j])
{
if(b[i]<b[j])
{
if(c[i]<c[j])
max[i]++;
}
}
}
if(ma<max[i])
ma=max[i];
}
g<<ma<<endl;
}
}