Submission #84420

#TimeUsernameProblemLanguageResultExecution timeMemory
84420talip생물 실험 (IZhO13_expgorl)C++14
0 / 100
1092 ms724 KiB
#include <bits/stdc++.h> #define ld long double #define calc() sqrtl((lax-gox)*(lax-gox)+(lay-goy)*(lay-goy)) using namespace std; ld mini(ld a, ld b){ if(a>b){ return b; } return a; } ld maxi(ld a, ld b){ if(a>b){ return a; } return b; } /* ld calc(ld lax, ld lay, ld gox, ld goy){ return ; }*/ int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ld k; string s; cin >> k >> s; ld lax, lay, gox, goy; cin >> lax >> lay >> gox >> goy; ld mindis=calc(), maxdis; maxdis=mindis; ld dis=maxdis; //cout << mindis << " " << maxdis; for(int r=0;k>r;r++){ for(int i=0;s.length()>i;i++){ if(s[i]=='I')continue; else if(s[i]=='R')gox++; else if(s[i]=='L')gox--; else if(s[i]=='F')goy++; else if(s[i]=='B')goy--; dis=calc(); mindis=mini(mindis, dis); maxdis=maxi(maxdis, dis); //cout << mindis << " " << maxdis << "\n"; } } cout << setprecision(12) << fixed << mindis << " " << maxdis; }

Compilation message (stderr)

expgorl.cpp: In function 'int main()':
expgorl.cpp:32:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0;s.length()>i;i++){
                     ~~~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...