fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. long[] seed = new long[23];
  14. seed[0] = 0x9876_5432L;
  15. seed[1] = 0xF1E2_D3C4L;
  16. int[][] t = new int[8][16];
  17. for (int i = 2; i < seed.length; i++)
  18. {
  19. seed[i] = seed[i - 2] ^ (seed[i - 1] >> (i - 1)) ^ (seed[i - 1] << ((i + i + 1) & 0xF));
  20. seed[i] &= 0xFFFF_FFFFL;
  21. long e = seed[i];
  22. for (int j = 0; j < 8; j++)
  23. {
  24. t[j][(int)(e & 0xFL)]++;
  25. e >>= 4;
  26. }
  27. }
  28. for (int i = 0; i < 8; i++)
  29. {
  30. for (int j = 0; j < 16; j++)
  31. {
  32. System.out.printf("%3d ", t[i][j]);
  33. }
  34. System.out.println();
  35. }
  36. }
  37. }
Success #stdin #stdout 0.11s 34956KB
stdin
Standard input is empty
stdout
  4   1   1   2   1   2   2   2   0   0   1   1   0   1   2   1 
  1   3   0   0   1   3   2   1   2   3   2   0   2   0   1   0 
  2   1   1   3   0   2   1   1   0   1   4   1   0   1   2   1 
  0   0   2   2   2   1   3   0   1   2   1   1   3   0   0   3 
  2   0   2   3   1   3   1   1   0   1   1   0   1   1   1   3 
  2   0   3   0   1   0   2   3   2   0   1   1   1   3   2   0 
  2   2   0   0   0   0   3   1   2   4   1   1   1   2   1   1 
  1   1   2   1   1   1   0   1   0   2   2   1   3   4   1   0