Submission #89046

# Submission time Handle Problem Language Result Execution time Memory
89046 2018-12-10T09:01:55 Z temoyanteladze Experiments with Gorlum (IZhO13_expgorl) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long
#define x first
#define y second
using namespace std;
double func(ll x1,ll y1,ll x2,ll y2){
double db=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
return db;
};
int main() {
ll n;
string v;
cin>>n>>v;
ll x1,y1,x2,y2;
cin>>x1>>y1;
cin>>x2>>y2;
double mn=10e7,mx=0;

ll s=v.size();
for (ll i=1;i<=n;i++)
for (ll i=0;s;i++)
{
    if(v[i]=="L")
        x2--;
    if (v[i]=="R")
        x2++;
    if (v[i]=="F")
        y2++;
    if (v[i]=="B")
        y2--;
  ll t=func(x1,y1,x2,y2);
      mn=min(mn,double(t));
      mx=max(mx,double(t));
}


cout<<fixed<<setprecision(9)<<mn<<' ';
cout<<fixed<<setprecision(9)<<mx<<endl;
	return 0;
}

Compilation message

expgorl.cpp: In function 'int main()':
expgorl.cpp:23:14: warning: comparison with string literal results in unspecified behavior [-Waddress]
     if(v[i]=="L")
              ^~~
expgorl.cpp:23:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
expgorl.cpp:25:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
     if (v[i]=="R")
               ^~~
expgorl.cpp:25:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
expgorl.cpp:27:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
     if (v[i]=="F")
               ^~~
expgorl.cpp:27:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
expgorl.cpp:29:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
     if (v[i]=="B")
               ^~~
expgorl.cpp:29:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]