제출 #1066939

#제출 시각아이디문제언어결과실행 시간메모리
1066939MunkhErdeneA Plus B (IOI23_aplusb)C++17
컴파일 에러
0 ms0 KiB
#include "aplusb.h" #include <vector> #include <set> #define ll long long using namespace std; #define no cout<<"NO"<<endl #define yes cout<<"YES"<<endl const ll mod=998244353; vector<int> smallest_sums(int n, std::vector<int>arr1, std::vector<int>arr2){ std::sort(arr2.begin(), arr2.end()); std::sort(arr1.begin(), arr1.end()); int g=0; int h=0; std::vector <int> result(100'000); for(int i=0 ; i<n ; i++){ result[i]=arr1[g]+arr2[h]; if(arr1[g+1]+arr2[h]>arr1[g]+arr2[h+1]){ h++; } else{ g++; } } return result; }

컴파일 시 표준 에러 (stderr) 메시지

aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:11:10: error: 'sort' is not a member of 'std'
   11 |     std::sort(arr2.begin(), arr2.end());
      |          ^~~~
aplusb.cpp:12:7: error: 'sort' is not a member of 'std'
   12 |  std::sort(arr1.begin(), arr1.end());
      |       ^~~~