QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#291398#2425. The Collection GameMax_s_xaM0 1ms3752kbC++20981b2023-12-26 15:00:372023-12-26 15:00:38

Judging History

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

  • [2023-12-26 15:00:38]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3752kb
  • [2023-12-26 15:00:37]
  • 提交

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)
                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)
                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: 3732kb

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

input:

10 5000

output:

946149565 1 2
946149565 4 3
946149565 -1

result:

points 0.0 points  0.0 Not correct

Subtask #3:

score: 0
Wrong Answer

Test #10:

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

input:

500 1000

output:

946149565 1 2
946149565 4 3
946149565 -1

result:

points 0.0 points  0.0 Not correct

Subtask #4:

score: 0
Wrong Answer

Test #15:

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

input:

10 5000

output:

946149565 1 2
946149565 4 3
946149565 -1

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%