QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#461304 | #8812. Library 3 | thangthang | 0 | 1ms | 3796kb | C++20 | 773b | 2024-07-02 17:36:56 | 2024-07-02 17:36:58 |
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);
}
Details
Tip: Click on the bar to expand more detailed information
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%