제출 #1252070

#제출 시각아이디문제언어결과실행 시간메모리
1252070antarbanikFinding Routers (IOI20_routers)C++20
컴파일 에러
0 ms0 KiB
#include "routers.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_routers(int l, int n, int q){
    vector<int> ans;

    ans.pb(0);

    for(int i = 1;i<=l;++i){
        if(use_detector(i) == 0) continue;
        ans.push_back((i-1)*2);
    }

        
    return ans;
}

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

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:7:9: error: 'class std::vector<int>' has no member named 'pb'
    7 |     ans.pb(0);
      |         ^~