#include using namespace std; using ll = long long; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)<> a >> b; map memo; while(true){ string s = generate_random_string(); ll hash = get_hash(s, a, b); // そのハッシュ知ってる if(memo.count(hash)>0){ p(memo[hash]); p(s); return 0; }else{ memo[hash] = s; } } return 0; }