×

# Editorial for XORNEY - PELT2019

 0 Question Code: XORNEY Prerequisites: Implementation Problem Setter: tds115 Difficulty: Cakewalk Explanation: Given two integer l and r, you have to find if xor from l to r is even or odd. Basically, you have to find the number of odd integer between l and r. Since xor of odd 1’s is 1 and xor of even 1’s is 0. You can make 2 cases:- (Let count be the number of odd's) If l is even and r is even-> count=(r-l)/2 Else -> count=(r-l)/2+1 If count is even then ans is even Else odd. Complexity-O(1) for each query Author’s solution: https://ideone.com/GUjqC5 asked 11 Jan, 18:01 5★panik 116●6 accept rate: 7%
 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:

×1,600
×10
×2
×2