# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3524 | solveit | Divide into triangle (kriii1_D) | C++98 | 0 ms | 1688 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <string>
#include <math.h>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
struct Pole {
int idx, x, y;
};
int N;
Pole A[1005];
int compare(Pole p1, Pole p2) {
if(p1.x < p2.x)
return true;
if(p1.x == p2.x && p1.y < p2.y)
return true;
return false;
}
int main() {
scanf("%d",&N);
for(int i = 1;i<=3 * N;i++) {
int x, y;
scanf("%d %d",&x,&y);
A[i].idx = i;
A[i].x = x;
A[i].y = y;
}
sort(A + 1, A + 1 + 3 * N, compare);
for(int i = 1;i<=3 * N;i+=3) {
printf("%d %d %d\n", A[i].idx, A[i + 1].idx, A[i + 2].idx);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |