You are not logged in. Please login at www.codechef.com to post your questions!

×

chef and strange addition

problem-link text

logic- I converted A and B in binary form and stored it in array A[] and B[] respectively.

-> traverse array A[] for every A[i] is set and B[i] is reset mark pos as i do following step

  • loop starting index to pos if A[j] is 0 && B[j] is 1

         count++;
    

display count.

What im doing is increasing the value of A by factor x, and if its possible to decrease B by same factor- overall sum is not going to change.

Why im getting WA what im missing.

Thanks

asked 21 Oct '18, 15:36

code_man's gravatar image

3★code_man
46
accept rate: 8%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×3,820
×77
×1

question asked: 21 Oct '18, 15:36

question was seen: 147 times

last updated: 21 Oct '18, 15:36