# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18614 | hongjun7 | Divide into triangle (kriii1_D) | C++14 | 1 ms | 1112 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 <stdio.h>
#include <algorithm>
using namespace std;
const double inf = 1e9;
int n;
struct P {
double x, y, g;
int idx;
} p[999];
inline bool cmp(P a, P b) {
return a.g < b.g;
}
int main() {
scanf("%d", &n);
for (int i = 1; i <= 3 * n; i++) {
scanf("%lf%lf", &p[i].x, &p[i].y);
p[i].g = (p[i].y - inf) / (p[i].x - 2 * inf);
p[i].idx = i;
}
sort(p + 1, p + 3 * n + 1, cmp);
for (int i = 1; i <= 3 * n; i += 3) printf("%d %d %d\n", p[i].idx, p[i + 1].idx, p[i + 2].idx);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |