http://www.spoj.com/problems/CRAN02/
My Algorithm :[deleted]
deleted after AC
Integer Overflow
yes indeed ! , but why ?integer z overflow , although it's equal to second map integer which indicate to frequency of B that do not come more than n time !size of integer 10^9 , isn't it ?
You had one calculation where you were multiply and int*int and then assigning it to a long long. The multiplication was overflowing.
yes i miss this point , thanks