# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1009162 | bornag | 생물 실험 (IZhO13_expgorl) | C++14 | 1082 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
ll lx, ly, gx, gy;
string s, si;
unordered_map<int, ld> sqs;
ll k;
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cout << fixed << setprecision(12);
cin >> k >> si;
for(int i = 0; i < si.size(); i++){
if(si[i] != 'I') s+=si[i];
}
cin >> lx >> ly >> gx >> gy;
ld mxi = -1;
ld mni = LLONG_MAX;
ld di = abs(gx-lx)*abs(gx-lx) + abs(gy-ly)*abs(gy-ly);
mxi = max(mxi, di);
mni = min(mni, di);
for(int i = 0; i < k; i++){
for(int j = 0; j < s.size(); j++){
char c = s[j];
if(c == 'L') gx--;
else if(c == 'R') gx++;
else if(c == 'F') gy++;
else if(c == 'B') gy--;
di = abs(gx-lx)*abs(gx-lx) + abs(gy-ly)*abs(gy-ly);
mxi = max(mxi, di);
mni = min(mni, di);
}
}
cout << sqrt(mni) << ' ' << sqrt(mxi) << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |