为什么它会 CE
  • 板块学术版
  • 楼主__vector__
  • 当前回复2
  • 已保存回复2
  • 发布时间2022/9/24 09:54
  • 上次更新2023/10/27 10:12:01
查看原帖
为什么它会 CE
507348
__vector__楼主2022/9/24 09:54

RT. 为什么换成 map 就正常了。

#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_cxx;
namespace Main
{
	struct Node
	{
		int id,val;
		bool operator <(const Node& b)const
		{
			if(val==b.val)return id<b.id;
			return val<b.val;
		}
	}node;
	unordered_map<Node,int> mp;
	void main()
	{
		node.id=1;
		node.val=1;
		mp[node]=114514;
		printf("%d",mp[node]);
	}	
}
int main()
{
	Main::main();
	return 0;
}

2022/9/24 09:54
加载中...