QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#129723#2425. The Collection Gamebashkort0 2ms3764kbC++201.0kb2023-07-22 22:41:192023-07-22 22:41:35

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-22 22:41:35]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3764kb
  • [2023-07-22 22:41:19]
  • 提交

answer

#include "swaps.h"
#include <bits/stdc++.h>

using namespace std;

void solve(int n, int V) {
    vector<int> ord(n);
    iota(ord.begin(), ord.end(), 1);

    vector<pair<int, int>> pairs;

    auto add = [&](int i, int j) {
        schedule(ord[i], ord[j]);
        pairs.emplace_back(i, j);
    };
    auto sort = [&]() {
        vector<int> v = visit();
        for (int k = 0; k < size(v); ++k) {
            if (!v[k]) {
                swap(ord[pairs[k].first], ord[pairs[k].second]);
            }
        }
        pairs.clear();
    };

    int N = 1 << __lg(n - 1) + 1;
    for (int s = 1; s < N; s <<= 1) {
        for (int k = s; k > 0; k >>= 1) {
            for (int j = k % s; j + k < n; j += 2 * k) {
                for (int i = 0; i < k && j + k + i < n; ++i) {
                    if ((j + i) / 2 * s == (j + i + k) / 2 * s) {
                        add(j + i, j + i + k);
                    }
                }
            }
            sort();
        }
    }

    answer(ord);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Accepted

Test #1:

score: 0
Accepted
time: 1ms
memory: 3696kb

input:

4 50
2 0 0
0
0

output:

946149565 1 2
946149565 3 4
547293220
547293220
547293220
345685428 2 1 4 3

result:

points 1.0 points  1.0 Correct

Subtask #2:

score: 0
Wrong Answer

Test #2:

score: 0
Wrong Answer
time: 2ms
memory: 3752kb

input:

10 5000
5 0 0 0 0 0
0
0
0
0
0
0
0
0
0

output:

946149565 1 2
946149565 3 4
946149565 5 6
946149565 7 8
946149565 9 10
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
345685428 2 1 4 3 6 5 8 7 10 9

result:

points 0.0 points  0.0 Not correct

Subtask #3:

score: 0
Wrong Answer

Test #10:

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

input:

500 1000
250 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0 1 1 1 0 0 1 0...

output:

946149565 1 2
946149565 3 4
946149565 5 6
946149565 7 8
946149565 9 10
946149565 11 12
946149565 13 14
946149565 15 16
946149565 17 18
946149565 19 20
946149565 21 22
946149565 23 24
946149565 25 26
946149565 27 28
946149565 29 30
946149565 31 32
946149565 33 34
946149565 35 36
946149565 37 38
94614...

result:

points 0.0 points  0.0 Not correct

Subtask #4:

score: 0
Wrong Answer

Test #15:

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

input:

10 5000
5 1 1 1 1 1
0
0
0
0
0
0
0
0
0

output:

946149565 1 2
946149565 3 4
946149565 5 6
946149565 7 8
946149565 9 10
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
547293220
345685428 1 2 3 4 5 6 7 8 9 10

result:

points 0.0 points  0.0 Not correct

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #4:

0%

Subtask #7:

score: 0
Skipped

Dependency #2:

0%

Subtask #8:

score: 0
Skipped

Dependency #4:

0%

Subtask #9:

score: 0
Skipped

Dependency #3:

0%

Subtask #10:

score: 0
Skipped

Dependency #8:

0%

Subtask #11:

score: 0
Skipped

Dependency #9:

0%

Subtask #12:

score: 0
Skipped

Dependency #10:

0%

Subtask #13:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%