Submission #3436

#TimeUsernameProblemLanguageResultExecution timeMemory
3436joinsungDivide into triangle (kriii1_D)C++98
1 / 1
4 ms1856 KiB
#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 timeMemoryGrader output
Fetching results...