Submission #3425

#TimeUsernameProblemLanguageResultExecution timeMemory
3425mjy0503Divide into triangle (kriii1_D)C++98
1 / 1
0 ms1204 KiB
#include <stdio.h> #include <algorithm> #include <string.h> #include <vector> int n; struct q{ int x,y,no; bool operator() (q a,q b){ return a.x<b.x || (a.x==b.x && a.y<b.y); } }su[10001]; int main(){ scanf("%d",&n); int i; for(i=0;i<3*n;i++){ scanf("%d %d",&su[i].x,&su[i].y); su[i].no=i+1; } std::sort(su,su+n*3,q()); for(i=0;i<n;i++){ printf("%d %d %d\n",su[i*3].no,su[i*3+1].no,su[i*3+2].no); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...