#include<string>
#include<iostream>
unsigned long long hash( std::string str )
{
unsigned long long _hash = 5381;
for( unsigned char znak: str )
_hash =(( _hash << 5 ) + _hash ) + znak; /* hash * 33 + c */
return _hash;
}
int main()
{
std::string s = "witam";
std::cout << hash( s );
}
I2luY2x1ZGU8c3RyaW5nPgojaW5jbHVkZTxpb3N0cmVhbT4KdW5zaWduZWQgbG9uZyBsb25nIGhhc2goIHN0ZDo6c3RyaW5nIHN0ciApCnsKICAgIHVuc2lnbmVkIGxvbmcgbG9uZyBfaGFzaCA9IDUzODE7CiAgICBmb3IoIHVuc2lnbmVkIGNoYXIgem5hazogc3RyICkKICAgICAgICAgX2hhc2ggPSgoIF9oYXNoIDw8IDUgKSArIF9oYXNoICkgKyB6bmFrOyAvKiBoYXNoICogMzMgKyBjICovCiAgIAogICAgcmV0dXJuIF9oYXNoOwp9CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6c3RyaW5nIHMgPSAid2l0YW0iOwogICAgc3RkOjpjb3V0IDw8IGhhc2goIHMgKTsKfQ==