# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3441 | Apple_Cplus | Divide into triangle (kriii1_D) | C++98 | 0 ms | 1684 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |