# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
5336 | ansol4328 | 생물 실험 (IZhO13_expgorl) | C++98 | 0 ms | 1108 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<string.h>
#include<math.h>
char a[10000];
int main()
{
int n, lx, ly, x, y;
int dy[4]={-1,0,1,0};
int dx[4]={0,1,0,-1};
int i, k;
double max, min, h;
scanf("%d",&n);
scanf(" %s",&a);
scanf("%d %d",&lx,&ly);
scanf("%d %d",&x,&y);
max=min=hypot(x-lx,y-ly);
for(i=0 ; i<strlen(a) ; i++)
{
if(a[i]=='L') k=3;
if(a[i]=='R') k=1;
if(a[i]=='F') k=0;
if(a[i]=='B') k=2;
if(a[i]=='I') break;
x+=dx[k], y+=dy[k];
h=hypot(x-lx,y-ly);
if(max<h) max=h;
if(min>h) min=h;
}
printf("%.12lf %.12lf",min,max);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |