#define A 0x9e3779b97f4a7c15 #define B 0xbf58476d1ce4e5b9 #define C 0x94d049bb133111eb static inline unsigned long splitmix64(unsigned long x) { x += A; x = (x ^ (x >> 30)) * B; x = (x ^ (x >> 27)) * C; return x ^ (x >> 31); } int f[10000]; int e[10000]; { int @n,@a[n]; ull h=0; ll z=0; unordered_map m; m[0]=1; rep(i,n){ int b=Factor(a[i],f,e); rep(j,b){ if(e[j]&1){ h^=splitmix64(f[j]); } } z+=m[h]++; } wt(z); }