# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4319 | kipa00 | Divide into triangle (kriii1_D) | C++98 | 0 ms | 348 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 <cstdio>
#include <algorithm>
using namespace std;
class Fence {
public:
int x, y, n;
bool operator<(const Fence f) const {
bool res = x < f.x;
if (x == f.x) {
return y < f.y;
}
return res;
}
};
int main() {
Fence arr[900];
int N, i;
scanf("%d", &N);
N *= 3;
for (i=0; i<N; ++i) {
Fence ff;
int x, y;
scanf("%d %d", &x, &y);
ff.x = x; ff.y = y;
ff.n = i + 1;
arr[i] = ff;
}
sort(arr, arr+N);
for (i=0; i<N;) {
printf("%d ", arr[i].n);
if (!((++i) % 3)) {
printf("\n");
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |