Submission #3441

#TimeUsernameProblemLanguageResultExecution timeMemory
3441Apple_CplusDivide into triangle (kriii1_D)C++98
0 / 1
0 ms1684 KiB
#include <stdio.h> #include <iostream> #include <vector> #include <queue> #include <algorithm> #include <sstream> #include <set> #include <map> #include <stack> #include <cmath> #include <cstdlib> #include <cstring> #include <string> using namespace std; struct data { int x,y,id; data() {} bool operator < (const data &rhs) const { if(x == rhs.x) return y < rhs.y; else return x < rhs.x; } }D[333]; int n; int x[333],y[333]; int main() { scanf("%d",&n); for(int i=0;i<3*n;++i) scanf("%d%d",&D[i].x,&D[i].y), D[i].id = i+1; sort(D, D+n); for(int i=0;i<n;++i) { printf("%d %d %d\n",D[3*i].id,D[3*i+1].id,D[3*i+2].id); } }
#Verdict Execution timeMemoryGrader output
Fetching results...