关于set的迭代器与报错
  • 板块学术版
  • 楼主EnriqueYXH
  • 当前回复4
  • 已保存回复4
  • 发布时间2022/7/10 19:39
  • 上次更新2023/10/27 21:11:45
查看原帖
关于set的迭代器与报错
497711
EnriqueYXH楼主2022/7/10 19:39

与题目内容无关

有无大佬明白为什么这里begin()不报错rbegin()报错

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
const int N = 2e5 + 5;
struct node{
	int a, t, id;
}song[N];
bool operator < (node x, node y) {
	return (x.t == y.t) ? (x.a > y.a) : (x.t < y.t);
}
multiset <node> s1, s2;
typedef multiset<node>::iterator it;
int main() {
	it x = s1.begin();
	it y = s1.rbegin();
	return 0;
}
2022/7/10 19:39
加载中...