# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3436 | joinsung | Divide into triangle (kriii1_D) | C++98 | 4 ms | 1856 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 <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
int n;
cin>>n;
vector< pair<int,int> > points;
for (int ni=0;ni<n*3;ni++) {
int x,y;
cin >> x >> y;
points.push_back(make_pair(x,y));
}
vector< pair<double, int> > list;
for (int ni=0;ni<n*3;ni++) {
double dx = points[ni].first + 1000001;
double dy = points[ni].second + 1000001;
double angle = atan(dy/dx);
list.push_back(make_pair(angle, ni+1));
}
sort(list.begin(), list.end());
for (int ni=0;ni<n*3;ni++) {
cout << list[ni].second;
if (ni%3==2)
cout<<endl;
else
cout<<" ";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |