| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1009086 | tarpent | Experiments with Gorlum (IZhO13_expgorl) | C++14 | 239 ms | 65536 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
long long n,gx,gy,lx,ly;
string pu,u;
long double mi,ma,tr;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	cin>>n;
	cin>>pu;
	for(int i = 0; i<n; i++){
		u+=pu;
	}
	cin>>lx>>ly>>gx>>gy;
	mi= LLONG_MAX;
	ma=0;
	for(auto e: u){
		if(e=='L'){
			gx-=1;
		}
		else if(e=='R'){
			gx+=1;
		}
		else if(e=='F'){
			gy+=1;
		}
		else if(e=='B'){
			gy-=1;
		}
		else if(e=='I'){
			continue;
		}
		
		tr=sqrt(abs(lx-gx)*abs(lx-gx) +abs(ly-gy)*abs(ly-gy));
		if(tr>ma) ma = tr;
		if(tr<mi) mi = tr;
	}
	cout<<fixed;
	
	cout<<setprecision(12);
	cout<<mi<<' '<<ma;
	
	
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
