Advertisement
am1x

xorcubes002.cpp

Feb 11th, 2023
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <inttypes.h>
  3. #include <assert.h>
  4.  
  5. typedef uint32_t uint_t;
  6. const uint32_t N = 1 << 11, P = 998244353;
  7.  
  8. static uint32_t cubes[N];
  9.  
  10. int main()
  11. {
  12.     for (uint64_t i = 0; i < N; i++) {
  13.         cubes[i] = (i * i % P) * i % P;
  14.     }
  15.  
  16.     uint64_t res = 0;
  17.     for (uint32_t n = 1; n < N; n++) {
  18.         for (uint32_t j = 0; j < n; j++) {
  19.             uint64_t rn = 0;
  20.             for (uint32_t k = 0; k < j; k++) {
  21.                 rn +=  cubes[n ^ k] * (uint64_t) cubes[j ^ k] % P;
  22.             }
  23.             res = (res + rn * 6 % P * cubes[n ^ j]) % P;
  24.         }
  25.         printf("%4u: %9u \n", n, (uint32_t) res);
  26.     }
  27.  
  28. }
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement