# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3417 | Qwaz | Divide into triangle (kriii1_D) | C++98 | 0 ms | 1096 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 <cstdio>
#include <algorithm>
const int MAX=310;
struct pos {
int x, y, num;
bool operator < (const pos &t) const {
if(y == t.y)
return x < t.x;
return y < t.y;
}
};
int n;
pos data[MAX*3];
void input(){
scanf("%d", &n);
n *= 3;
int i;
for(i=0; i<n; i++){
scanf("%d%d", &data[i].x, &data[i].y);
data[i].num = i+1;
}
}
void solve(){
std::sort(data, data+n);
pos p, q;
int i;
for(i=0; i<n; i++){
if(i%3 == 0)
p = data[i];
else if(i%3 == 1)
q = data[i];
else
printf("%d %d %d\n", p.num, q.num, data[i].num);
}
}
int main(){
input();
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |