Submission #208815

#TimeUsernameProblemLanguageResultExecution timeMemory
208815TAISA_Wiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
#include "wiring.h" long long min_total_length(std::vector<int> r, std::vector<int> b) { int n=r.size(),m=b.size(); if(r.back()<b[0]){ reverse(all(b)); ll res=0; if(n<=m){ for(int i=0;i<n;i++){ res+=b[i]-r[i]; } for(int i=n;i<m;i++){ res+=b[i]-r.back(); } }else{ for(int i=0;i<m;i++){ res+=b[i]-r[i]; } for(int i=m;i<n;i++){ res+=b[0]-r[i]; } } return res; } return 0; }

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:6:11: error: 'all' was not declared in this scope
   reverse(all(b));
           ^~~
wiring.cpp:6:3: error: 'reverse' was not declared in this scope
   reverse(all(b));
   ^~~~~~~
wiring.cpp:7:3: error: 'll' was not declared in this scope
   ll res=0;
   ^~
wiring.cpp:10:5: error: 'res' was not declared in this scope
     res+=b[i]-r[i];
     ^~~
wiring.cpp:13:5: error: 'res' was not declared in this scope
     res+=b[i]-r.back();
     ^~~
wiring.cpp:17:5: error: 'res' was not declared in this scope
     res+=b[i]-r[i];
     ^~~
wiring.cpp:20:5: error: 'res' was not declared in this scope
     res+=b[0]-r[i];
     ^~~
wiring.cpp:23:10: error: 'res' was not declared in this scope
   return res;
          ^~~