답안 #1038428

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1038428 2024-07-29T19:17:02 Z fv3 가장 긴 여행 (IOI23_longesttrip) C++17
컴파일 오류
0 ms 0 KB
#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

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))
      | ^~~~~