Submission #1225587

#TimeUsernameProblemLanguageResultExecution timeMemory
1225587tamzidFinding Routers (IOI20_routers)C++20
Compilation error
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; }

Compilation message (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);
      |           ^~