# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
4318 | kipa00 | Divide into triangle (kriii1_D) | C++98 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <algorithm>
using namespace std;
class Fence {
public:
int x, y, n;
bool operator<(Fence f) {
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;
}