# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
88973 | mate | Experiments with Gorlum (IZhO13_expgorl) | C++11 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
//freopen("input.txt","r",expgorl.in);
//freopen("output.txt","w",expgorl.out);
string t,s;
long long int k,lx,ly,gx,gy,i,j,m,n;
cin >> k;
cin >> s;
cin >> lx >> ly;
cin >> gx >> gy;
long long int x=(lx-gx)*(lx-gx),y=(ly-gy)*(ly-gy);
long long int dis=sqrt(x+y);
long long int mx=dis,mn=dis;
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 << mn << mx;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |