QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#461304#8812. Library 3thangthang0 1ms3796kbC++20773b2024-07-02 17:36:562024-07-02 17:36:58

Judging History

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

  • [2024-07-02 17:36:58]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3796kb
  • [2024-07-02 17:36:56]
  • 提交

answer

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

using namespace std;

void solve(int N){
    vector <int> ans;
    for (int i = 0; i < N; ++ i) ans.push_back(i);

    int last = query(ans);
    for (int i = 1; i < N; ++ i){
        int cur = i;
        int l = 0;
        int r = i - 1;
        while (l <= r){
            int mid = l + r >> 1;
            vector <int> ask = ans;
            ask[0] = ans[i];
            for (int i = 1; i <= mid; ++ i) ask[i] = ans[i - 1];
            ask[i] = ans[0];
            if (query(ask) > last + mid){
                cur = mid;
                r = mid - 1;
            }
            else l = mid + 1;
        }
        swap(ans[i], ans[cur]);
        last = query(ans);
    }

    answer(ans);
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

2
0
1
1

output:

? 0 1
? 1 0
? 1 0
! 1 0
-

result:

wrong answer Wrong Answer [8]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%