use proconio::input; use std::collections::HashMap; use std::collections::BTreeSet; fn main(){ input!{ n:usize, } let mut c=0; let mut a=n; while a>0{ if a%2==1{ c+=1; } a>>=1; } let mut d=(1<0{ if a%2==1{ ans+=b*(d&1);d>>=1; } b<<=1;a>>=1; } print!("{}",ans); }