QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#123502#91. Secret Permutationbashkort#0 0ms0kbC++20673b2023-07-12 18:16:252024-07-04 00:37:19

Judging History

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

  • [2024-07-04 00:37:19]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-12 18:16:25]
  • 提交

answer

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

using namespace std;

mt19937 rnd(228);

void solve(int n) {
    vector<int> p(n);
    iota(p.begin(), p.end(), 1);
    shuffle(p.begin(), p.end(), rnd);

    int best = query(p);

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n - 1; ++j) {
            swap(p[j], p[j + 1]);
            int now = query(p);
            if (now < best) {
                best = now;
            } else {
                swap(p[j], p[j + 1]);
            }
        }
    }

    vector<int> ans(n);

    for (int i = 1; i <= n; ++i) {
        ans[p[i - 1] - 1] = i;
    }

    answer(ans);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Time Limit Exceeded

Test #1:

score: 0
Time Limit Exceeded

input:

7
5 7 1 3 2 4 6

output:

Unauthorized output

result:


Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%