Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- using namespace std;
- ifstream fin("parap.in");
- ofstream fout("parap.out");
- int n, i, c, nr;
- long long fr[1040], sol, val;
- int main()
- {
- fin>>n;
- for(i=1; i<=n; i++)
- {
- fin>>val;
- nr=0;
- while(val!=0)
- {
- c=val%10;
- c=(1<<c);
- nr=(nr^c);
- val/=10;
- }
- fr[nr]++;
- }
- for(i=0; i<=1023; i++)
- if(fr[i]>=2)
- sol+=1LL*fr[i]*(fr[i]-1)/2;
- fout<<sol;
- return 0;
- }
Add Comment
Please, Sign In to add comment