# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3600 | jihoon | Divide into triangle (kriii1_D) | C++98 | 0 ms | 1096 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>
#define swap(aa,bb) {int cc;cc=aa;aa=bb;bb=cc;}
int a[900][3]={0};
int main(){
int n;
int i,j;
scanf("%d",&n);
for(i=1;i<=3*n;i++){
scanf("%d %d",&a[i][0],&a[i][1]);
a[i][2]=i;
}
for(i=1;i<=3*n;i++){
for(j=i+1;j<=3*n;j++){
if(a[i][0]>a[j][0]){
swap(a[i][0],a[j][0]);
swap(a[i][1],a[j][1]);
swap(a[i][2],a[j][2]);
}else if(a[i][0]==a[j][0]){
if(a[i][1]>a[j][1]){
swap(a[i][0],a[j][0]);
swap(a[i][1],a[j][1]);
swap(a[i][2],a[j][2]);
}
}
}
}
/*
for(i=1;i<=3*n;i++){
for(j=0;j<3;j++){
printf("%d ",a[i][j]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |