Cod sursa(job #525172)

Utilizator mening12001Andrei Geogescu mening12001 Data 24 ianuarie 2011 16:12:11
Problema Cutii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include<iostream.h>
#include<fstream.h>
struct cutie{long x,y,z;};

int main()
{ifstream f("cutii.in");
ofstream h("cutii.out");	
long i,n,m,j,k=0;
cutie a[350000];

	f>>n>>m;
while(!f.eof())
	{for(i=1;i<=n;i++)
	f>>a[i].x>>a[i].y>>a[i].z;
for(i=1;i<n;i++)
	for(j=i+1;j<=n;j++)
		if((a[i].x<a[j].x&&a[i].y<a[j].y&&a[i].z<a[j].z)||(a[i].x>a[j].x&&a[i].y>a[j].y&&a[i].z>a[j].z))
	k++;
	h<<k<<endl;
	k=0;
	}	
	
	
	
	return 0;}