Submission #630680

#TimeUsernameProblemLanguageResultExecution timeMemory
630680samedWiring (IOI17_wiring)C++14
Compilation error
0 ms0 KiB
long long min_total_length(std::vector<int> a, std::vector<int> b) { long long answer = 0; int n = a.size(); int m = b.size(); long long k = b[0]; for(int i=0;i<n;i++) { answer += k - a[i]; } for(int i=1;i<m;i++) { answer += b[i] - k; } return answer; }

Compilation message (stderr)

wiring.cpp:1:33: error: 'vector' is not a member of 'std'
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
      |                                 ^~~~~~
wiring.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
  +++ |+#include <vector>
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
wiring.cpp:1:40: error: expected primary-expression before 'int'
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
      |                                        ^~~
wiring.cpp:1:53: error: 'vector' is not a member of 'std'
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
      |                                                     ^~~~~~
wiring.cpp:1:53: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
wiring.cpp:1:60: error: expected primary-expression before 'int'
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
      |                                                            ^~~
wiring.cpp:1:66: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | long long min_total_length(std::vector<int> a, std::vector<int> b) {
      |                                                                  ^