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