Submission #3650

# Submission time Handle Problem Language Result Execution time Memory
3650 2013-08-31T07:18:08 Z The_KMJ_God Divide into triangle (kriii1_D) C++
1 / 1
0 ms 1096 KB
#include<stdio.h>
#include<algorithm>
using namespace std;
class xy
{
public:
	int x,y,ind;
	bool operator<(const xy &in)const{
		return y<in.y;
	}
};
int n;
xy num[910];
int main()
{
	int i,ind2[3];
	scanf("%d",&n);
	for(i=0;i<n*3;i++)
	{
		scanf("%d",&num[i].x);
		scanf("%d",&num[i].y);
		num[i].ind=i+1;
	}
	sort(num,num+n*3);
	for(i=0;i<n;i++)
	{
		ind2[0]=num[i*3].ind;
		ind2[1]=num[i*3+1].ind;
		ind2[2]=num[i*3+2].ind;
		sort(ind2,ind2+3);
		printf("%d %d %d\n",ind2[0],ind2[1],ind2[2]);
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1096 KB Output is correct
2 Correct 0 ms 1096 KB Output is correct
3 Correct 0 ms 1096 KB Output is correct
4 Correct 0 ms 1096 KB Output is correct
5 Correct 0 ms 1096 KB Output is correct
6 Correct 0 ms 1096 KB Output is correct
7 Correct 0 ms 1096 KB Output is correct
8 Correct 0 ms 1096 KB Output is correct
9 Correct 0 ms 1096 KB Output is correct
10 Correct 0 ms 1096 KB Output is correct
11 Correct 0 ms 1096 KB Output is correct
12 Correct 0 ms 1096 KB Output is correct
13 Correct 0 ms 1096 KB Output is correct
14 Correct 0 ms 1096 KB Output is correct
15 Correct 0 ms 1096 KB Output is correct
16 Correct 0 ms 1096 KB Output is correct
17 Correct 0 ms 1096 KB Output is correct
18 Correct 0 ms 1096 KB Output is correct
19 Correct 0 ms 1096 KB Output is correct
20 Correct 0 ms 1096 KB Output is correct