Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

SIGSEGV in COOK42 - ABCSTR

$
0
0

I've employed the same method described in the editorial just the implementation is a bit different. For each index calculate the no. of A's, B's, and C's till that index. Then calculate A[i]-B[i], B[i]-C[i] for each index. Store them in a structure. Sort them out. If there are X continuous pairs for which these are equal, add C(x,2) to the final count. I am getting SIGSEGV and am not able to spot out the error. Any help would be appreciated.

Link for the code : link text


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>