#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class Xorshift { private: unsigned x, y, z, w; public: Xorshift(unsigned seed=88675123, int loop=50){ x = 123456789; y = 362436069; z = 521288629; w = seed; while(--loop >= 0){ (*this)(); } } unsigned operator()(){ unsigned t=(x^(x<<11)); x=y; y=z; z=w; return w=(w^(w>>19))^(t^(t>>8)); } unsigned operator()(unsigned size){ return (*this)() % size; } }; Xorshift xorshift; long long getHash(const string& s, int a, int b) { int n = s.size(); long long hash = 0; for(int i=0; i> a >> b; map memo; for(;;){ int n = 100; string s(n, ' '); for(int i=0; isecond << endl << s << endl; return 0; } memo[hash] = s; } }