#include<bits/stdc++.h>
using namespace std;
struct Node
{
int a;
int b;
bool operator<(const Node temp)const{ //加个比较函数就行
if(a==temp.a) return b<temp.b;
return a<temp.a;
}
}x;
map<Node,int>mp;
int main()
{
x.a=1;
x.b=2;
mp[x]=1;
return 0;
}
结构体为下标(map实现)
最新推荐文章于 2023-06-28 16:37:07 发布