QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#129716#2425. The Collection Gamebashkort0 5ms3916kbC++20925b2023-07-22 22:35:372023-07-22 22:36:03

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:36:03]
  • 评测
  • 测评结果:0
  • 用时:5ms
  • 内存:3916kb
  • [2023-07-22 22:35:37]
  • 提交

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]);
            }
        }
    };

    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) {
                    add(j + i, j + i + k);
                }
            }
            sort();
        }
    }

    answer(ord);
}

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: 3704kb

input:

4 50
2 0 0
2 1 0
1 0

output:

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

result:

points 0.0 points  0.0 Not correct

Subtask #2:

score: 0
Wrong Answer

Test #2:

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

input:

10 5000
5 0 0 0 0 0
4 0 0 1 1
4 1 0 0 0
4 0 0 1 1
4 1 0 0 0
4 0 0 0 0
2 0 1
2 0 1
4 1 0 0 0
4 0 0 0 0

output:

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

result:

points 0.0 points  0.0 Not correct

Subtask #3:

score: 0
Wrong Answer

Test #10:

score: 0
Wrong Answer
time: 5ms
memory: 3916kb

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: 0ms
memory: 3712kb

input:

10 5000
5 1 1 1 1 1
4 1 1 1 1
4 1 1 1 1
4 1 1 1 1
4 1 1 1 1
4 1 1 1 1
2 1 1
2 1 1
4 1 1 1 1
4 1 1 1 1

output:

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

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:

0%