Submission #3675

#TimeUsernameProblemLanguageResultExecution timeMemory
3675hyeonjae0310Jogging (kriii1_J)C++98
0 / 1
1000 ms2676 KiB
#include <iostream> #include <algorithm> #include <cmath> using namespace std; typedef struct point{ int x; int y; } point; bool compare(point p1, point p2) { if(p1.x==p2.x) return (p1.y<p2.y); else return (p1.x<p2.x); } point star[100000]; int main() { int n,m; int i,j; int pos; double ang,max; cin>>n>>m; for(i=0;i<n;i++) { cin>>star[i].x>>star[i].y; } sort(star,star+n,compare); for(i=0;i<m;i++) { max=0; cin>>pos; for(j=0;j<n;j++) { if(pos<star[j].x){ ang=atan2(star[j].y,star[j].x-pos); if(max<ang) max=ang; } } cout.precision(7); cout<<fixed<<max<<'\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...