We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It passed all test cases for me and I cannot think why it shouldn't with r==1 and a very long list of (repeated) values. Combinatorics would be unnecessary since each value is processed individually (so there's no need for a (n)*(n+1) /2 )
However if you're going over the long maximum you'd need to change the maps to long long (and probably change res to __uint128_t)
Can you post or link such a test case? The solution appears to have helped other implementations (above python's being an example) and no problems other than your's have been reported yet.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Count Triplets
You are viewing a single comment's thread. Return to all comments →
It passed all test cases for me and I cannot think why it shouldn't with r==1 and a very long list of (repeated) values. Combinatorics would be unnecessary since each value is processed individually (so there's no need for a (n)*(n+1) /2 )
However if you're going over the long maximum you'd need to change the maps to long long (and probably change res to __uint128_t)
Can you post or link such a test case? The solution appears to have helped other implementations (above python's being an example) and no problems other than your's have been reported yet.