#include #include #include #include #include using namespace std; /* * Author * Robin Lee (hex539) * * Algorithm * Run a rolling hash over the whole clock's difference string and take * the minimum of that. * * Complexity * O(NlogN) */ template uint64_t hash_str(basic_string s,uint64_t mul,uint64_t mod){ mod = (mod % (1llu<<30llu)) + 77; mul = (mul % (mod - 5)) + 2; vector power(s.length()+1, 1); for (int i=1; i<=s.length(); i++) power[i]=(power[i-1]*mul)%mod; uint64_t hash_str=0; for (int i=0; i v(n); for (int i=0; i>v[i]; sort(v.begin(),v.end()); static int param[4][2]={}; while (not param[0][0]){ for (int i=4; i--;) for (int j=2; j--;) param[i][j]=rand(); } basic_string s; for (int i=0; i>n; cout<<(read_clock(n)==read_clock(n)? "possible": "impossible")<