제출 #208815

#제출 시각아이디문제언어결과실행 시간메모리
208815TAISA_전선 연결 (IOI17_wiring)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (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;
          ^~~