Submission #5337

# Submission time Handle Problem Language Result Execution time Memory
5337 2014-04-05T14:06:42 Z ansol4328 Experiments with Gorlum (IZhO13_expgorl) C++
0 / 100
0 ms 1108 KB
#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
1 Incorrect 0 ms 1108 KB Output isn't correct
2 Incorrect 0 ms 1108 KB Output isn't correct
3 Incorrect 0 ms 1108 KB Output isn't correct
4 Incorrect 0 ms 1108 KB Output isn't correct
5 Incorrect 0 ms 1108 KB Output isn't correct
6 Incorrect 0 ms 1108 KB Output isn't correct
7 Incorrect 0 ms 1108 KB Output isn't correct
8 Incorrect 0 ms 1108 KB Output isn't correct
9 Incorrect 0 ms 1108 KB Output isn't correct
10 Incorrect 0 ms 1108 KB Output isn't correct
11 Incorrect 0 ms 1108 KB Output isn't correct
12 Incorrect 0 ms 1108 KB Output isn't correct
13 Incorrect 0 ms 1108 KB Output isn't correct
14 Incorrect 0 ms 1108 KB Output isn't correct
15 Incorrect 0 ms 1108 KB Output isn't correct
16 Incorrect 0 ms 1108 KB Output isn't correct
17 Incorrect 0 ms 1108 KB Output isn't correct
18 Incorrect 0 ms 1108 KB Output isn't correct
19 Incorrect 0 ms 1108 KB Output isn't correct
20 Incorrect 0 ms 1108 KB Output isn't correct