I am getting WA for the question:http://www.codechef.com/problems/NOTATRI/ Anyone plz. explain where i am wrong.Thnx. My code: http://www.codechef.com/viewsolution/2213497 asked 09 Jun '13, 11:49

sorting will help in terms of time. after sorting, start from the greatest value of length, if sum of smallest value and value lesser than(l[k1]) taken value(l[k]), then add difference to count(cnt=cnt+l[k1]l[i]), because sum of all indices between those numbers, if considered particularly, will be lesser than taken value(l[k]). if sum of those two particular indices is greater than or equal to taken value(l[i]+l[j]>=l[k]), then increment the smallest index(i++). loop the aforementioned case for all index. voila. answered 05 Jan '14, 08:35

1.What we will be doing is , we will take a set of 3 lengths say {first,second,third} such that first<=second<=third. This way we will count only unique sets. For a better understanding of solution look here answered 16 May '14, 21:11
