# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88970 | 2018-12-10T07:23:07 Z | mate | Experiments with Gorlum (IZhO13_expgorl) | C++14 | 2 ms | 256 KB |
#include <bits/stdc++.h> using namespace std; int main() { //freopen("input.txt","r",expgorl.in); //freopen("output.txt","w",expgorl.out); string t,s; long long int k,lx,ly,gx,gy,i,j,m,n; cin >> k; cin >> s; cin >> lx >> ly; cin >> gx >> gy; long long int x=(lx-gx)*(lx-gx),y=(ly-gy)*(ly-gy); long long int dis=sqrt(x+y); long long int mx=dis,mn=dis; for (i=0;i<s.size();i++) { if (s[i]=='L') gx=gx-1; if (s[i]=='R') gx=gx+1; if (s[i]=='F') gy=gy+1; if (s[i]=='B') gy=gy-1; x=(lx-gx)*(lx-gx); y=(ly-gy)*(ly-gy); dis=sqrt(x+y); mx=max(mx,dis); mn=min(mn,dis); } cout << mn << mx; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |