답안 #89075

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89075 2018-12-10T09:35:08 Z temoyanteladze 생물 실험 (IZhO13_expgorl) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>
#define ll long long
#define x first
#define y second
using namespace std;
double func(double x1,double y1,double x2,double y2){
double db=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return sqrt(db);
}
double func1(double x,double y){
double db=(x)*(x)+(y)*(y);
return sqrt(db);
};
int main() {
ll n;
string v;
cin>>n>>v;
double x1,y1,x2,y2;
cin>>x1>>y1;
cin>>x2>>y2;
double mn=10e7,mx=0;
mx=func(x1,y1,x2,y2);
mn=mx;
double a1=x2-x1;
double b1=y2-y1;
double x=x2-x1;
double y=y2-y1;
double c1,d1;
double c=a1;
double d=b1;
for (ll i=0;i<v.size();i++)
{
    if(v[i]=='L')
        x--;
    if (v[i]=='R')
        x++;
    if (v[i]=='F')
        y++;
    if (v[i]=='B')
        y--;
  double t=func1(x,y);
      mn=min(mn,t);
      mx=max(mx,t);
       c=min(x2-x1-a1,c);
       d=min(y2-y1-b1,d);
      
}
 c*=n;
 d*=n;
 double t1=func1(c,d);
  mn=min(mn,t1);
      mx=max(mx,t1);
 
cout<<fixed<<setprecision(9)<<mn<<' '<<fixed<<setprecision(9)<<mx;
	return 0;
}

Compilation message

expgorl.cpp: In function 'int main()':
expgorl.cpp:31:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 for (ll i=0;i<v.size();i++)
             ~^~~~~~~~~
expgorl.cpp:28:8: warning: unused variable 'c1' [-Wunused-variable]
 double c1,d1;
        ^~
expgorl.cpp:28:11: warning: unused variable 'd1' [-Wunused-variable]
 double c1,d1;
           ^~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -