# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
84688 | talip | Experiments with Gorlum (IZhO13_expgorl) | C++14 | 4 ms | 376 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>
#define ld long double
#define calc() sqrt((lax-gox)*(lax-gox)+(lay-goy)*(lay-goy))
using namespace std;
ld mini(ld a, ld b){
if(a>b){
return b;
}
return a;
}
ld maxi(ld a, ld b){
if(a>b){
return a;
}
return b;
}
/*
ld calc(ld lax, ld lay, ld gox, ld goy){
return ;
}*/
int main(){
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ld k; string s; cin >> k >> s;
ld lax, lay, gox, goy; cin >> lax >> lay >> gox >> goy;
ld mindis=calc(), maxdis; maxdis=mindis;
ld dis=maxdis;
//cout << mindis << " " << maxdis;
for(int r=0;mini((long double)(k), 100.0)>r;r++){
for(int i=0;s.length()>i;i++){
if(s[i]=='R')gox++;
if(s[i]=='L')gox--;
if(s[i]=='F')goy++;
if(s[i]=='B')goy--;
if(s[i]=='I')continue;
dis=calc();
mindis=mini(mindis, dis);
maxdis=maxi(maxdis, dis);
//cout << mindis << " " << maxdis << "\n";
}
}
cout << setprecision(12) << fixed << mindis << " " << maxdis;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |