fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String s;
  10. while ((s = in.readLine())!=null) {
  11. long k = Long.parseLong(s);
  12. System.out.println(k^(k>>1));
  13. }
  14. }
  15. }
Success #stdin #stdout 0.03s 2184192KB
stdin
10
50
stdout
15
43