# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
89058 | temoyanteladze | 생물 실험 (IZhO13_expgorl) | C++14 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define x first
#define y second
using namespace std;
double func(double x1,double y1,double x2,double y2){
double db=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return sqrt(db);
};
int main() {
ll n;
string v;
cin>>n>>v;
double x1,y1,x2,y2;
cin>>x1>>y1;
cin>>x2>>y2;
double mn=10e7,mx=0;
for (ll i=0;i<v.size();i++)
{
if(v[i]=='L')
x2--;
if (v[i]=='R')
x2++;
if (v[i]=='F')
y2++;
if (v[i]=='B')
y2--;
double t=func(x1,y1,x2,y2);
mn=min(mn,double(t));
mx=max(mx,double(t));
}
cout<<setprecision(9)<<mn<<' ';
cout<<setprecision(9)<<mx;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |