Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

NUMBER THEORY(GCD and BIT).please help

Revision en1, by XX86, 2020-07-21 14:16:58

https://codeforces.com/problemset/problem/1110/C IN this problem,when a=2x−1. This implies gcd(a⊕b,a&b)=gcd(2x−1−b,b)=gcd(2x−1,b), since gcd(x,x+y)=gcd(x,y) (for all x and y), hence it's sufficient to find the largest non trivial divisor of a — it will be the desired answer.(From editorial) But,why this work? Can someone please explain the solution in more detail? Will be grateful if anyone can help. /*sorry for poor English*/

Tags #number theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English XX86 2020-07-21 14:16:58 474 Initial revision (published)