Cod sursa(job #41985)

Utilizator mariaciPopa Marius Ionut mariaci Data 28 martie 2007 19:23:43
Problema Cutii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.61 kb
#include<fstream.h>
#define InFile "cutii.in"
#define OutFile "cutii.out"
int n,t;
typedef struct
{ int x,y,z;
}Pct;
Pct a[3510];
int main()
{ ifstream f(InFile);
  f>>n>>t;
  int i,j,k=0,max;
  i=1;
  ofstream g(OutFile);
  while(i<=t)
    { k=1;
      max=0;
      f>>a[1].x>>a[1].y>>a[1].z;
      for(j=2;j<=n;j++)
       { f>>a[j].x>>a[j].y>>a[j].z;
	 if(a[j].x>a[j-1].x && a[j].y>a[j-1].y && a[j].z>a[j-1].z) k++;
	 else { if(k>max && k!=1) max=k;
		k=1;
	      }
       }
      if(k>max && k!=1) max=k;
      g<<max<<"\n";
      i++;
    }
  f.close();
  g.close();
  return 0;
}