# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
3455 | pichulia | Jogging (kriii1_J) | C++98 | 152 ms | 4436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<algorithm>
using namespace::std;
#define M 100000005
double PI;
struct P{
double x, y;
double radis;
}a[100005];
int n, m;
double b[100005];
bool compare(P p, P q)
{
return p.radis > q.radis;
}
void input()
{
PI = acos(0.0)*2;
int i, j;
scanf("%d %d",&n,&m);
for(i=0; i<n; i++)
{
scanf("%lf %lf",&a[i].x,&a[i].y);
a[i].radis = atan2(a[i].y, a[i].x + M);
}
for(i=0; i<m; i++)
scanf("%lf",&b[i]);
sort(a,a+n,compare);
}
void process()
{
int i, j=0;
double k;
for(i=0; i<m; i++)
{
k=0;
for(; j<n; j++)
{
k = atan2(a[j].y,a[j].x - b[i]);
if(k<PI/2)
break;
}
printf("%.7lf\n",k);
}
}
void output()
{
}
int main()
{
input();
process();
output();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |