# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89029 | mate | Experiments with Gorlum (IZhO13_expgorl) | C++14 | 2 ms | 256 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 <bits/stdc++.h>
using namespace std;
int main()
{
string t,s;
double k,lx,ly,gx,gy,i,j,m,n;
cin >> k;
cin >> s;
cin >> lx >> ly;
cin >> gx >> gy;
double x=(lx-gx)*(lx-gx),y=(ly-gy)*(ly-gy);
double dis=sqrt(x+y);
double mx=dis,mn=dis;
for (j=0;j<n;j++)
for (i=0;i<s.size();i++)
{
if (s[i]=='L') gx=gx-1;
if (s[i]=='R') gx=gx+1;
if (s[i]=='F') gy=gy+1;
if (s[i]=='B') gy=gy-1;
x=(lx-gx)*(lx-gx);
y=(ly-gy)*(ly-gy);
dis=sqrt(x+y);
mx=max(mx,dis);
mn=min(mn,dis);
}
cout<<fixed<<setprecision(9)<<mn<<' '<<fixed<<setprecision(9)<<mx;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |