This is a library of policy-based elementary data structures: associative containers and priority queues. It is designed for high-performance, flexibility, semantic safety, and conformance to the corresponding containers in std and std::tr1 (except for some points where it differs by design).
using namespace __gnu_pbds;//前面双下划线
一、hash(速度快的恐怖)。
http://codevs.cn/problem/1230/
#include<stdio.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
__gnu_pbds::gp_hash_table<int, bool> gf;
inline int in()
{
int res=0;
char c=getchar();
while(c<'0'||c>'9') c=getchar();
while(c>='0'&&c<='9') res=res*10+c-48,c=getchar();
return res;
}
int main