# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
3844 | shinhj88 | Divide into triangle (kriii1_D) | C++98 | 0 ms | 1092 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<stdlib.h>
typedef struct{
int x, y, idx;
}Str;
Str str[900];
int n;
int cmp(const void * a, const void * b){
if(*(int *)a==*(int *)b){
return ((Str *)b)->y-((Str *)a)->y;
}
return *(int *)b-*(int *)a;
}
int main(){
int i, j;
scanf("%d", &n);
for(i=0;i<n*3;++i){
scanf("%d%d", &str[i].x, &str[i].y);
str[i].idx=i+1;
}
qsort(str, 3*n, sizeof(Str), cmp);
for(i=0;i<n;++i){
for(j=0;j<2;++j){
printf("%d ", str[i*3+j].idx);
}
printf("%d\n", str[i*3+j].idx);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |