# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3675 | hyeonjae0310 | Jogging (kriii1_J) | C++98 | 1000 ms | 2676 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |