Submission #3449

#TimeUsernameProblemLanguageResultExecution timeMemory
3449wurikijiDivide into triangle (kriii1_D)C++98
1 / 1
0 ms1676 KiB
#include <cstdio> #include <cstring> #include <cstdlib> #include <string> #include <vector> #include <sstream> #include <iostream> #include <algorithm> using namespace std; struct point{ int x; int y; int i; point(int a, int b, int c) : x(a), y(b), i(c) {} }; vector<point> ls; bool ss(point a, point b ) { if( a.x == b.x) return a.y < b.y; return a.x < b.x; } int main(void){ int n; scanf("%d",&n); ls.clear(); for(int i = 0 ;i <3 * n ;i++) { int a, b; scanf("%d %d",&a,&b); ls.push_back(point(a,b,i)); } sort(ls.begin(),ls.end(),ss); for(int i = 0 ;i < 3*n;i++) { printf("%d ", ls[i].i + 1); if( i %3 == 2 )printf("\n"); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...