Submission #1038428

#TimeUsernameProblemLanguageResultExecution timeMemory
1038428fv3Longest Trip (IOI23_longesttrip)C++17
Compilation error
0 ms0 KiB
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; vector<int> longest_trip(int N,int D) { vector<int> v(N); atoi(v.begin(),v.end(),0); return v; }

Compilation message (stderr)

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:7:17: error: cannot convert 'std::vector<int>::iterator' to 'const char*'
    7 |     atoi(v.begin(),v.end(),0);
      |          ~~~~~~~^~
      |                 |
      |                 std::vector<int>::iterator
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
                 from /usr/include/c++/10/bits/stl_algobase.h:59,
                 from /usr/include/c++/10/vector:60,
                 from longesttrip.h:1,
                 from longesttrip.cpp:1:
/usr/include/stdlib.h:361:1: note:   initializing argument 1 of 'int atoi(const char*)'
  361 | __NTH (atoi (const char *__nptr))
      | ^~~~~