Submission #4109

#TimeUsernameProblemLanguageResultExecution timeMemory
4109jaysDivide into triangle (kriii1_D)C++98
1 / 1
0 ms1096 KiB
#include <algorithm> #include <cstdio> using namespace std; struct Stake { int x, y, id; bool operator < (const Stake& s) const { return x != s.x ? x < s.x : y < s.y; } }; int N; Stake s[901]; int main() { scanf("%d", &N); for (int i = 0; i < 3 * N; ++i) { scanf("%d%d", &s[i].x, &s[i].y); s[i].id = i + 1; } sort(s, s + 3 * N); for (int i = 0; i < N; ++i) printf("%d %d %d\n", s[3*i].id, s[3*i+1].id, s[3*i+2].id); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...