Gdy próbuje kompilować to dostaje:
‘struct std::_Rb_tree_const_iterator<std::pair<int, int> >’ has no member named ‘first’
Co robię źle?
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
#define FOR(x, y, z) for (int z = x; z < y; z++)
#define FORD(x, y, z) for (int z = x; z > y; z--)
const int MOD = 1e9 + 7;
int main(){
ios::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int n, m, k_id, can_drive, c_amount, s_amount;
cin >> n >> m;
vector<int> change_order (n+1);
set<pair<int, int>> s;
char kind_of_ins;
FOR(0, m, instruction){
cin >> kind_of_ins;
if (kind_of_ins == 'U'){
cin >> k_id >> can_drive;
s.insert({k_id, can_drive});
change_order[k_id] = instruction;
}
else{
cin >> c_amount >> s_amount;
int act_can_drive = 0, act_c_amount = 0;
auto beg = s.begin(), end = --s.end();
while (beg != end){
act_can_drive += *beg.first;
while (act_can_drive < s_amount){
//tutaj dalszcza czesc kodu ktory bede pisal
}
}
}
}
return 0;
}