Submission #84447

#TimeUsernameProblemLanguageResultExecution timeMemory
84447farukkastamonudaExperiments with Gorlum (IZhO13_expgorl)C++14
0 / 100
1086 ms544 KiB
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define lo long long #define inf 1000000000 #define md 1000000007 #define pb push_back #define li 100005 using namespace std; int k,lx,ly,gx,gy; char s[li]; double mx,mn=inf; double abs1(double a){ if(a<=0) return -a; return a; } double dis(int a,int b){ double aa=a,bb=b; double cc=lx,dd=ly; return sqrt(abs1(aa-cc)*abs1(aa-cc)+abs1(bb-dd)*abs1(bb-dd)); } int main(){ scanf("%d",&k); scanf("%s",s+1); int t=strlen(s+1); scanf("%d %d %d %d",&lx,&ly,&gx,&gy); mx=max(mx,dis(gx,gy)); mn=min(mn,dis(gx,gy)); //if(k<=20000 && t<=2000){ for(int i=1;i<=k;i++){ for(int j=1;j<=t;j++){ if(s[j]=='L'){ gx--; } if(s[j]=='R'){ gx++; } if(s[j]=='F'){ gy++; } if(s[j]=='B'){ gy--; } mx=max(mx,dis(gx,gy)); mn=min(mn,dis(gx,gy)); } } printf("%lf\n%lf\n",mn,mx); //} return 0; }

Compilation message (stderr)

expgorl.cpp: In function 'int main()':
expgorl.cpp:24:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&k);
  ~~~~~^~~~~~~~~
expgorl.cpp:25:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s+1);
  ~~~~~^~~~~~~~~~
expgorl.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d %d",&lx,&ly,&gx,&gy);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...