Submission #934456

# Submission time Handle Problem Language Result Execution time Memory
934456 2024-02-27T10:50:08 Z vjudge1 Wall (IOI14_wall) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <wall.h>
using namespace std;

void buildWall(int n, int k, vector <int> op, vector <int> left, vector <int> right,
vector <int> h, vector <int> &ans){
	for(int i = 0; i < n; i++){
		ans.pb(0);
	}
	for(int i = 0; i < k; i++){
		for(int j = left[i]; j <= right[i]; j++){
			if(op[i] == 1) ans[j] = max(h[i], ans[j]);
			else ans[j] = min(ans[j], h[i]);
		}
	}
}

Compilation message

wall.cpp: In function 'void buildWall(int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>&)':
wall.cpp:8:7: error: 'class std::vector<int>' has no member named 'pb'
    8 |   ans.pb(0);
      |       ^~