Submission #84441

#TimeUsernameProblemLanguageResultExecution timeMemory
84441talipExperiments with Gorlum (IZhO13_expgorl)C++14
0 / 100
1063 ms688 KiB
#include <bits/stdc++.h> using namespace std; //Yeter calis artik //Scanf hurmetine. Pls. char s[10002]; int x[10001]; int y[10001]; int main(){ int lax, lay, gox, goy, n, k; long double mini=1.0E6, maxi=0, ans; scanf("%d %s %d %d %d %d",&k,s+1,&lax,&lay,&gox,&goy); n=strlen(s+1); x[0]=gox-lax; y[0]=goy-lay; for(int i=1;i<=n;i++){ x[i]=x[i-1]; y[i]=y[i-1]; switch(s[i]){ case 'L': x[i]--; break; case 'R': x[i]++; break; case 'F': y[i]++; break; case 'B': y[i]--; break; } } for(int i=0;i<=n;i++){ for(int j=0;j<k;j++){ ans=sqrtl(1LL*(x[i]+j*(x[n]-x[0]))*(x[i]+j*(x[n]-x[0]))+1LL*(y[i]+j*(y[n]-y[0]))*(y[i]+j*(y[n]-y[0]))); if(mini>ans){ mini=ans; } if(ans>maxi){ maxi=ans; } } } printf("%.14Lf %.14Lf", mini, maxi); }

Compilation message (stderr)

expgorl.cpp: In function 'int main()':
expgorl.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %s %d %d %d %d",&k,s+1,&lax,&lay,&gox,&goy); n=strlen(s+1);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...