| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1009053 | tarpent | Experiments with Gorlum (IZhO13_expgorl) | C++14 | 160 ms | 35000 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int 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>>gx>>gy>>lx>>ly;
	mi= LLONG_MAX*100;
	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)^2 +abs(ly-gy)^2);
		if(tr>ma) ma = tr;
		if(tr<mi) mi = tr;
	}
	cout<<fixed;
	
	cout<<setprecision(9);
	cout<<mi<<' '<<ma;
	
	
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
