/* ハッシュ化 */ #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; vector> prime_factor(ll n){ vector> res; for(ll i=2;i*i<=n;i++){ if(n%i==0){ pair tmp; tmp.first=i; tmp.second=0; while(n%i==0){ tmp.second++; n/=i; } res.push_back(tmp); } } if(n>1){ res.emplace_back(n,1); n/=n; } return res; } int main(){ int N; cin>>N; vector a(N); for(int i=0;i>a[i]; } std::random_device seed_gen; mt19937 engine(seed_gen()); uniform_int_distribution dist(1LL,1LL<<60);//[1,1LL<<60]までの乱数 vector b(N),c(N+1); map mp;//mp[v]=vに対しての乱数 for(int i=0;i mp2; for(int i=0;i