제출 #1225587

#제출 시각아이디문제언어결과실행 시간메모리
1225587tamzidFinding Routers (IOI20_routers)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "routers.h"
using namespace std;

vector<int> find_routers(int l, int n, int q) {
  //   int idx = use_detector(0);
  //   std::vector<int> ans;
  //   for (int i = 0; i < n; i++) {
	// 	ans.push_back(0);
	// }
	// return ans;

  vector<int> ans;
  ans.pb(0);
  for(int i=l;i<=2;i--)
  {
    if(use_detector(i) == 1)
    {
      ans.pb(i);
      break;
    }
  }
  return ans;
}

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

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