Submission #90731

#TimeUsernameProblemLanguageResultExecution timeMemory
90731YottaByteExperiments with Gorlum (IZhO13_expgorl)C++14
0 / 100
811 ms66560 KiB
#include <iostream> #include <iomanip> #include <math.h> using namespace std; #define pb push_back #define mk make_pair #define fr first #define sc second #define ll long long void FS() { cout << fixed << setprecision(48); } main() { FS(); int k, lx, ly, gx, gy; string s; cin >> k >> s; cin >> lx >> ly; cin >> gx >> gy; string ss = ""; for(int i = 0; i < k; i++) ss += s; s = ss; double distmn = hypot((gy - ly), (gx - lx)); double distmx = hypot((gy - ly), (gx - lx)); for(int i = 0; i < s.size(); i++) { gx -= (s[i] == 'L'); gx += (s[i] == 'R'); gy += (s[i] == 'F'); gy -= (s[i] == 'B'); distmx = max(distmx, hypot((gy - ly), (gx - lx))); distmn = min(distmn, hypot((gy - ly), (gx - lx))); } cout << distmn << " " << distmx << endl; } /* 100000 LRFBI 10000 10000 10000 10000 */

Compilation message (stderr)

expgorl.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
expgorl.cpp: In function 'int main()':
expgorl.cpp:34:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < s.size(); i++)
                 ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...