about hash_set and hash_map
Moderator: Board moderators
about hash_set and hash_map
i know we can use these containers here in online judge, but i would like to know if they can be used in icpc regionals.
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
Code: Select all
struct word
{
char s[10];
};
struct hasher
{
size_t operator()( word x ) const
{
return hash< const char* >()( x.s );
}
};
struct eqstr
{
bool operator()(word a,word b)
{
return strcmp(a.s,b.s)==0;
}
};
typedef hash_map<word,string,hasher,eqstr > myhash;