×

# CONFLIP Getting WA

 0 Please tell me the error in my code http://www.codechef.com/viewsolution/3930436 asked 21 May '14, 18:42 357●2●9 accept rate: 43%

 1 Hey, just change if(n&1==0) to if((n&1)==0) This is a common mistake. While dealing with binary operators, '==' takes precedence over ' & '. Hence, "1==0" is computed before "n & 1". Here is the correct solution - www.codechef.com/viewsolution/3930657 answered 21 May '14, 20:16 3.4k●19●43●74 accept rate: 15% Thank you very much :) (21 May '14, 20:38)
 0 Hi Can you please check my code. It throws WA. https://www.codechef.com/viewsolution/13362508 answered 20 Apr, 23:19 0★shainsha 9●1 accept rate: 0% 1 @shainsha you cannot use Scanner and BufferedReader simultaneously on System.in. That is because both Scanner and BufferedReader use buffers to read from the input stream. As a result when you use the Scanner first the Scanner's buffer is filled to it's capacity (1024 chars), and not just what it returns. Hence what is left for the BufferedReader in the input stream is less than what you think. In summary, use Scanner or BufferedReader, but not both. (20 Apr, 23:58) meooow ♦5★
 0 guys, please upvote me. i am new here. nad not able to ask question answered 21 Apr, 03:07 67●2 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×823
×2

question asked: 21 May '14, 18:42

question was seen: 483 times

last updated: 21 Apr, 03:07