dra2421's blog

By dra2421, history, 4 years ago, In English

I suppose by Monogon Monogon's solution for this problem that the sufficient and necessary condition is 2*f <= 2*n -x-y , where f = number of most frequent color after making x matches. so in my solution when I write only this condition it gives the wrong answer on test case(2) first solution but after adding an extra condition it gets accepted corrected . can someone explain, please??

Full text and comments »

  • Vote: I like it
  • -24
  • Vote: I do not like it

By dra2421, history, 4 years ago, In English

why long long k =d ,cc=0 ; while(n >=k) cc += (n/k) ,k *=d; is wrong

while this is correct long long k =d ,cc=0 ; while(n) cc +=n/k , n /=k ;

Full text and comments »

  • Vote: I like it
  • -21
  • Vote: I do not like it