# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5336 | ansol4328 | Experiments with Gorlum (IZhO13_expgorl) | C++98 | 0 ms | 1108 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<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... |