제출 #169594

#제출 시각아이디문제언어결과실행 시간메모리
169594davitmargExperiments with Gorlum (IZhO13_expgorl)C++17
0 / 100
312 ms33836 KiB
/*DavitMarg*/ #include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <cstring> #include <map> #include <unordered_map> #include <set> #include <queue> #include <iomanip> #include <bitset> #include <stack> #include <cassert> #include <iterator> #include <fstream> #define mod 1000000007ll #define LL long long #define LD long double #define MP make_pair #define PB push_back #define all(v) v.begin(), v.end() using namespace std; const int N = 10004; LD dist(LL Y, LL X) { return sqrtl(Y * Y + X * X); } LL k, n, sx, sy, lx, ly, x, y; string s, t; LD mn, mx; int main() { cin >> k; cin >> t; s = "#"; while (k--) s += t; n = s.length() - 1; cin >> ly >> lx >> sy >> sx; ly -= sy; lx -= sx; sy = 0; sx = 0; mn = mx = dist(ly, lx); for (int i = 1; i <= n; i++) { if (s[i] == 'R') x++; else if (s[i] == 'L') x--; else if (s[i] == 'F') y++; else if (s[i] == 'B') y--; mn = min(mn, dist(y - ly, x - lx)); mx = max(mx, dist(y - ly, x - lx)); } printf("%.12f %.12f\n", (double)mn, (double)mx); return 0; } /* 2 BB 1000 1003 1000 1000 */
#Verdict Execution timeMemoryGrader output
Fetching results...