Comments

How to solve A no using DP ?

Draw a 3x3 matrix : { {1,2,3} , {4,5,6} , {7,8,9} } ; add (-1) with all elements ; mod all elements by column_number ; thus see for yourself

Aren't all numbers in the matrix unique ?

+18

Could someone please explain the DP approach of problem C of Div-2 ?

Thanks .

Could you please explain the process in detail ?

The link describes it as "Smallest positive integer k such that n = +-1+-2+-...+-k for some choice of +'s and -'s." What's the relation between this and problem B ?

For which problem ?

I used srand(time(0)) ; in your code and got WA at first at test-8 , then on test-10. But without using srand(time(0)) , your code gets AC . Any idea why this is happening ?

How to solve A using triangle inequality ?

You have solved similar problems like A-E ? If so , would you please give the links of some of those problems ?

k > 0

Could you please explain the work of this line of your code ? ans = min(ans,pre[i-m]+suf[i+1]);

Use freopen for reading & writing input-output from files. http://www.cplusplus.com/reference/cstdio/freopen/

On aza-zilmemset or just a loop??, 7 years ago
0

Is there any significant difference between i) memset ( ctrN , 0 , sizeof ctrN ) ; and ii) memset ( ctrN , 0 , n * sizeof(ll) ) ; // assuming n is size of the array ctrN

0

nice key-board . :) Would anyone please tell me the brand of it ??

On comfiCode Library, 7 years ago
0

Thanks .

Thanks for the link.

Auto comment: topic has been updated by UBERMENSCH. (previous revision, new revision, compare).