代码块中无序多集的编译错误17.12

compilation error with unordered multiset in codeblocks17.12

本文关键字:编译 错误 无序 代码      更新时间:2023-10-16

>1.错误:未在此范围内声明无序多集 2.一切都很好,除了unordered_multiset代码。

#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define present(container, element) (container.find(element) != container.end())
#define cpresent(container, element) (find(all(container),element) != container.end())
#define sz(a) int((a).size())
#define pb push_back
#define loop(start,end) for(int i=start;i<end;i++)
#define ll long long int
#define pii pair < int , int >
#define mset(x,v) memset(x, v, sizeof(x)) //search it
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
int main ()
{
ios_base::sync_with_stdio(false);cout.tie(0);cin.tie(0);
int n;
int q;
cin>>n;cin>>q;
unordered_multiset <int> s;
}

如果您使用正确的标头(在本例中为#include <unordered_set>(而不是<bits/stdc++.h>的可憎之物,那么 gcc 可能会帮助您启用 c++11 才能使用该标头。

您需要在编译器命令行上传递-std=c++11以启用 c++11 功能。

不相关,但所有这些#defines真的不是一个好主意,using namespace std也会引起问题。