QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#686553#8965. Jeloucup-team0040 3ms3780kbC++231.4kb2024-10-29 14:16:012024-10-29 14:16:01

Judging History

This is the latest submission verdict.

  • [2024-10-29 14:16:01]
  • Judged
  • Verdict: 0
  • Time: 3ms
  • Memory: 3780kb
  • [2024-10-29 14:16:01]
  • Submitted

answer

#include <bits/stdc++.h>

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int N;
    std::cin >> N;
    
    N /= 2;
    
    int F;
    std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
    while (true) {
        F = rng() % (1 << N) + (1 << N);
        
        bool ok = true;
        for (int s = 2; s < (1 << N); s++) {
            int x = F;
            
            int d = std::__lg(s);
            
            for (int i = N; i >= d; i--) {
                if (x >> i & 1) {
                    x ^= s << (i - d);
                }
            }
            
            if (x == 0) {
                ok = false;
                break;
            }
        }
        if (ok) {
            break;
        }
    }
    
    std::cout << (1 << N) << "\n";
    
    for (int x = 0; x < (1 << N); x++) {
        int y = 0;
        for (int i = 0; i < N; i++) {
            if (x >> i & 1) {
                y ^= x << i;
            }
        }
        for (int i = 2 * N - 1; i >= N; i--) {
            if (y >> i & 1) {
                y ^= F << (i - N);
            }
        }
        int a = x | (y << N);
        std::cout << a << " \n"[x == (1 << N) - 1];
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3780kb

input:

18

output:

512
0 513 2050 2563 8196 8709 10246 10759 32776 33289 34826 35339 40972 41485 43022 43535 131088 131601 133138 133651 139284 139797 141334 141847 163864 164377 165914 166427 172060 172573 174110 174623 212000 212513 209954 210467 203812 204325 201766 202279 244776 245289 242730 243243 236588 237101 ...

result:

wrong answer wrong plan

Subtask #2:

score: 0
Wrong Answer

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3648kb

input:

20

output:

1024
0 1025 4098 5123 16388 17413 20486 21511 65544 66569 69642 70667 81932 82957 86030 87055 262160 263185 266258 267283 278548 279573 282646 283671 327704 328729 331802 332827 344092 345117 348190 349215 451616 450593 455714 454691 435236 434213 439334 438311 517160 516137 521258 520235 500780 499...

result:

wrong answer wrong plan

Subtask #3:

score: 0
Wrong Answer

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 3780kb

input:

26

output:

8192
0 8193 32770 40963 131076 139269 163846 172039 524296 532489 557066 565259 655372 663565 688142 696335 2097168 2105361 2129938 2138131 2228244 2236437 2261014 2269207 2621464 2629657 2654234 2662427 2752540 2760733 2785310 2793503 8388640 8396833 8421410 8429603 8519716 8527909 8552486 8560679 ...

result:

wrong answer wrong plan

Subtask #4:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 1ms
memory: 3652kb

input:

28

output:

16384
0 16385 65538 81923 262148 278533 327686 344071 1048584 1064969 1114122 1130507 1310732 1327117 1376270 1392655 4194320 4210705 4259858 4276243 4456468 4472853 4522006 4538391 5242904 5259289 5308442 5324827 5505052 5521437 5570590 5586975 16777248 16793633 16842786 16859171 17039396 17055781 ...

result:

wrong answer wrong plan

Subtask #5:

score: 0
Wrong Answer

Test #5:

score: 0
Wrong Answer
time: 3ms
memory: 3724kb

input:

30

output:

32768
0 32769 131074 163843 524292 557061 655366 688135 2097160 2129929 2228234 2261003 2621452 2654221 2752526 2785295 8388624 8421393 8519698 8552467 8912916 8945685 9043990 9076759 10485784 10518553 10616858 10649627 11010076 11042845 11141150 11173919 33554464 33587233 33685538 33718307 34078756...

result:

wrong answer wrong plan