제출 #38114

#제출 시각아이디문제언어결과실행 시간메모리
38114Talant생물 실험 (IZhO13_expgorl)C++14
0 / 100
543 ms2028 KiB
#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) 메시지

expgorl.cpp:25:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main () {
       ^
expgorl.cpp: In function 'int main()':
expgorl.cpp:33:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (int j = 0; j < a.size(); j ++) {
                                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...