제출 #1009056

#제출 시각아이디문제언어결과실행 시간메모리
1009056tarpent생물 실험 (IZhO13_expgorl)C++14
0 / 100
173 ms34996 KiB
#include<bits/stdc++.h> using namespace std; int n,gx,gy,lx,ly; string pu,u; long double mi,ma,tr; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n; cin>>pu; for(int i = 0; i<n; i++){ u+=pu; } cin>>gx>>gy>>lx>>ly; mi= LLONG_MAX; for(auto e: u){ if(e=='L'){ gx-=1; } else if(e=='R'){ gx+=1; } else if(e=='F'){ gy+=1; } else if(e=='B'){ gy-=1; } else if(e=='I'){ continue; } tr=sqrt((abs(lx-gx))^2 +(abs(ly-gy))^2); if(tr>ma) ma = tr; if(tr<mi) mi = tr; } cout<<fixed; cout<<setprecision(12); cout<<mi<<' '<<ma; }

컴파일 시 표준 에러 (stderr) 메시지

expgorl.cpp: In function 'int main()':
expgorl.cpp:34:26: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   34 |   tr=sqrt((abs(lx-gx))^2 +(abs(ly-gy))^2);
      |                        ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...