# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
90733 | YottaByte | 생물 실험 (IZhO13_expgorl) | C++14 | 1081 ms | 548 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define ll long long
void FS() {
cout << fixed << setprecision(48);
}
main()
{
FS();
int k, lx, ly, gx, gy;
string s;
cin >> k >> s;
cin >> lx >> ly;
cin >> gx >> gy;
//string ss = "";
//for(int i = 0; i < k; i++)
//ss += s;
//s = ss;
int sx = gx;
int sy = gy;
double distmn = hypot((gy - ly), (gx - lx));
double distmx = hypot((gy - ly), (gx - lx));
double distmn1 = hypot((gy - ly), (gx - lx));
double distmx1 = hypot((gy - ly), (gx - lx));
for(int j = 0; j < k; j++)
{
for(int i = 0; i < s.size(); i++)
{
gx -= (s[i] == 'L');
gx += (s[i] == 'R');
gy += (s[i] == 'F');
gy -= (s[i] == 'B');
distmx1 = max(distmx1, hypot((gy - ly), (gx - lx)));
distmn1 = min(distmn1, hypot((gy - ly), (gx - lx)));
}
}
cout << distmn1 << " " << distmx1 << endl;
}
/*
100000
LRFBI
10000 10000
10000 10000
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |