# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
38114 | Talant | 생물 실험 (IZhO13_expgorl) | C++14 | 543 ms | 2028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
const int inf = (int)1e9 + 7;
const int N = (int)1e6 + 7;
double dist (int x,int y,int l,int r) {
return sqrt((x - l) * (x - l) + (y - r) * (y - r));
}
int k;
string a;
int x,y,l,r;
double mn = inf,mx = 0;
main () {
cin >> k;
cin >> a;
cin >> x >> y;
cin >> l >> r;
for (int i = 1; i <= k; i ++) {
for (int j = 0; j < a.size(); j ++) {
if (a[j] == 'L')
l --;
if (a[j] == 'R')
l ++;
if (a[j] == 'F')
r ++;
if (a[j] == 'B')
r --;
mn = min(mn,dist(x,y,l,r));
mx = max(mx,dist(x,y,l,r));
}
}
cout << fixed << setprecision(10) << mn << " " << fixed << setprecision(12) << mx << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |