Submission #3451

# Submission time Handle Problem Language Result Execution time Memory
3451 2013-08-31T05:52:33 Z Apple_Cplus Divide into triangle (kriii1_D) C++
1 / 1
0 ms 1684 KB
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
 
using namespace std;

struct data {
	int x,y,id;
	data() {}
	bool operator < (const data &rhs) const {
		if(x == rhs.x) return y < rhs.y;
		else return x < rhs.x;
	}
}D[333];

int n;
int x[333],y[333];

int main() {
	scanf("%d",&n);
	for(int i=0;i<3*n;++i) scanf("%d%d",&D[i].x,&D[i].y), D[i].id = i+1;
	sort(D, D+3*n);
	for(int i=0;i<n;++i) {
		printf("%d %d %d\n",D[3*i].id,D[3*i+1].id,D[3*i+2].id);
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1684 KB Output is correct
2 Correct 0 ms 1684 KB Output is correct
3 Correct 0 ms 1684 KB Output is correct
4 Correct 0 ms 1684 KB Output is correct
5 Correct 0 ms 1684 KB Output is correct
6 Correct 0 ms 1684 KB Output is correct
7 Correct 0 ms 1684 KB Output is correct
8 Correct 0 ms 1684 KB Output is correct
9 Correct 0 ms 1684 KB Output is correct
10 Correct 0 ms 1684 KB Output is correct
11 Correct 0 ms 1684 KB Output is correct
12 Correct 0 ms 1684 KB Output is correct
13 Correct 0 ms 1684 KB Output is correct
14 Correct 0 ms 1684 KB Output is correct
15 Correct 0 ms 1684 KB Output is correct
16 Correct 0 ms 1684 KB Output is correct
17 Correct 0 ms 1684 KB Output is correct
18 Correct 0 ms 1684 KB Output is correct
19 Correct 0 ms 1684 KB Output is correct
20 Correct 0 ms 1684 KB Output is correct