Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <inttypes.h>
- #include <assert.h>
- typedef uint32_t uint_t;
- const uint32_t N = 1 << 11, P = 998244353;
- static uint32_t cubes[N];
- int main()
- {
- for (uint64_t i = 0; i < N; i++) {
- cubes[i] = (i * i % P) * i % P;
- }
- uint32_t n = 0;
- int st = scanf("%u", &n);
- assert (st == 1);
- assert (n < N);
- n++;
- uint64_t res = 0;
- for (uint32_t i = 0; i < n; i++) {
- for (uint32_t j = 0; j < i; j++) {
- uint64_t rk = 0;
- for (uint32_t k = 0; k < j; k++) {
- rk += cubes[i ^ k] * (uint64_t) cubes[j ^ k];
- if (k % 16 == 15)
- rk %= P;
- }
- res = (res + rk % P * cubes[i ^ j]) % P;
- }
- }
- res = res * 6 % P;
- printf("%u\n", (uint32_t) res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement