QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#291404 | #2425. The Collection Game | Max_s_xaM | 0 | 2ms | 3788kb | C++20 | 989b | 2023-12-26 15:04:53 | 2023-12-26 15:04:53 |
answer
#include "swaps.h"
#include <iostream>
#include <algorithm>
#include <vector>
typedef long long ll;
typedef double lf;
using namespace std;
const int MAXN = 510;
int n, a[MAXN];
vector <int> ret, ans;
void solve(int N, int V)
{
n = N;
for (int i = 1; i <= n; i++) a[i] = i;
int w;
for (w = 1; w <= n; w <<= 1)
{
for (int j = w; j >= 1; j >>= 1)
{
for (int l = 1, r = j; r <= n; l += 2 * j, r = l + j - 1)
for (int i = l; i <= r && i + j <= n; i++)
if (l / (2 * w) & 1) schedule(a[i + j], a[i]);
else schedule(a[i], a[i + j]);
ret = visit(); int top = 0;
for (int l = 1, r = j; r <= n; l += 2 * j, r = l + j - 1)
for (int i = l; i <= r && i + j <= n; i++)
if (!ret[top++]) swap(a[i], a[i + j]);
}
}
for (int i = 1; i <= n; i++) ans.push_back(a[i]);
answer(ans);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Accepted
Test #1:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
4 50 2 0 0 2 1 0 2 0 1 0 2 1 1 2 1 0
output:
946149565 1 2 946149565 4 3 547293220 946149565 2 4 946149565 1 3 547293220 946149565 2 3 946149565 4 1 547293220 547293220 946149565 3 4 946149565 2 1 547293220 946149565 3 2 946149565 4 1 547293220 345685428 3 2 1 4
result:
points 1.0 points 1.0 Correct
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 3732kb
input:
10 5000 5 0 1 0 1 0 4 1 0 0 1 5 0 1 1 0 1 4 1 1 1 0 4 1 0 0 1 5 0 0 1 1 0 2 1 1 4 1 1 1 1 4 1 1 1 1 5 1 1 1 1 0
output:
946149565 1 2 946149565 4 3 946149565 5 6 946149565 8 7 946149565 9 10 547293220 946149565 2 3 946149565 1 4 946149565 7 6 946149565 8 5 547293220 946149565 2 4 946149565 3 1 946149565 5 7 946149565 8 6 946149565 10 9 547293220 946149565 4 7 946149565 2 5 946149565 3 8 946149565 1 6 547293220 946149...
result:
points 0.0 points 0.0 Not correct
Subtask #3:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 2ms
memory: 3736kb
input:
500 1000 250 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 1...
output:
946149565 1 2 946149565 4 3 946149565 5 6 946149565 8 7 946149565 9 10 946149565 12 11 946149565 13 14 946149565 16 15 946149565 17 18 946149565 20 19 946149565 21 22 946149565 24 23 946149565 25 26 946149565 28 27 946149565 29 30 946149565 32 31 946149565 33 34 946149565 36 35 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: 3612kb
input:
10 5000 5 1 1 1 1 1 4 1 1 1 1 5 1 1 1 1 1 4 1 1 1 1 4 1 1 1 1 5 1 1 1 1 1 2 1 1 4 1 1 1 1 4 1 1 1 1 5 1 1 1 1 1
output:
946149565 1 2 946149565 4 3 946149565 5 6 946149565 8 7 946149565 9 10 547293220 946149565 1 3 946149565 2 4 946149565 7 5 946149565 8 6 547293220 946149565 1 2 946149565 3 4 946149565 6 5 946149565 8 7 946149565 9 10 547293220 946149565 1 5 946149565 2 6 946149565 3 7 946149565 4 8 547293220 946149...
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%