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