제출 #881743

#제출 시각아이디문제언어결과실행 시간메모리
881743spdlingA Plus B (IOI23_aplusb)C++17
컴파일 에러
0 ms0 KiB
#include<vector> #include<set> vector<int> smallest_sums(int N, vector<int> A, vector<int> B) { vector<int> ans; int ans_n = 0; set<pair<int, pair<int, int>>> cands; for (int i = 0 ; i < N; ++i) { cands.insert({A[i] + B[0], {i, 0}}); } while (ans_n < N*N) { auto cur = cands.begin(); ans.push_back(cur->first); ans_n++; int i = cur->second.first; int j = cur->second.second; cands.erase(cur); if (j+1 < N) { cands.insert({A[i] + B[j+1], {i,j+1}}); } } return ans; }

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

aplusb.cpp:3:1: error: 'vector' does not name a type
    3 | vector<int> smallest_sums(int N, vector<int> A, vector<int> B) {
      | ^~~~~~