Submission #1009134

#TimeUsernameProblemLanguageResultExecution timeMemory
1009134tarpent생물 실험 (IZhO13_expgorl)C++14
0 / 100
1044 ms600 KiB
#include<bits/stdc++.h> using namespace std; long long n,gx,gy,lx,ly; string pu; double mi,ma,tr; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n; cin>>pu; cin>>lx>>ly>>gx>>gy; mi= INT_MAX; ma=0; for(int i = 0; i<n; i++){ for(char e: pu){ 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<mi) mi = tr; if(tr>ma) ma = tr; } } cout<<fixed; cout<<setprecision(12); cout<<mi<<' '<<ma; }
#Verdict Execution timeMemoryGrader output
Fetching results...