# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3808 | gs13068 | Divide into triangle (kriii1_D) | C++98 | 4 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<cstdio>
int x[900];
int y[900];
bool no[900];
int main()
{
double t;
int bot;
int i,j,k,n;
scanf("%d",&n);
for(i=0;i<n*3;i++)scanf("%d%d",&x[i],&y[i]);
j=0;
for(i=1;i<n*3;i++)
{
if(y[i]<y[j])
j=i;
}
printf("%d ",j+1);
no[j]=true;
bot=j;
for(i=1;i<n*3;i++)
{
for(k=0;no[k];k++);
for(j=k+1;j<n*3;j++)
{
if(no[j])continue;
if(1LL*(x[j]-x[bot])*(y[k]-y[bot])<1LL*(x[k]-x[bot])*(y[j]-y[bot]))
k=j;
}
printf("%d ",k+1);
no[k]=true;
if(i%3==2)puts("");
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |