QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#129719 | #2425. The Collection Game | bashkort | 0 | 5ms | 3756kb | C++20 | 949b | 2023-07-22 22:40:04 | 2023-07-22 22:40:08 |
Judging History
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) {
add(j + i, j + i + k);
}
}
sort();
}
}
answer(ord);
}
詳細信息
Subtask #1:
score: 0
Accepted
Test #1:
score: 0
Accepted
time: 1ms
memory: 3644kb
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 3 4 547293220 345685428 2 4 3 1
result:
points 1.0 points 1.0 Correct
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3756kb
input:
10 5000 5 0 0 0 0 0 4 0 0 1 1 4 0 0 0 0 4 1 1 1 1 4 1 1 1 1 4 1 1 1 1 2 1 1 2 0 0 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 2 4 946149565 1 3 946149565 6 8 946149565 5 7 547293220 946149565 3 2 946149565 1 6 946149565 5 8 946149565 7 10 547293220 946149565 4 1 946149565 2 8 946149565 3 5 946149565 6 10 547293220 946149565 3 1 94614...
result:
points 0.0 points 0.0 Not correct
Subtask #3:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 5ms
memory: 3652kb
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: 3752kb
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:
100%
Accepted
Dependency #2:
0%