QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#695244 | #8812. Library 3 | 275307894a | 0 | 0ms | 3832kb | C++14 | 1.7kb | 2024-10-31 19:35:58 | 2024-10-31 19:35:58 |
answer
#include "library3.h"
#include<bits/stdc++.h>
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define eb emplace_back
#define all(x) x.begin(),x.end()
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;
const int N=8000+5,M=300+5,K=1000+5,mod=998244353,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(28382);
#define Tp template<typename T>
#define Ts template<typename T,typename... Ar>
namespace Debug{
Tp void _debug(char* f,T t){cerr<<f<<'='<<t<<endl;}
Ts void _debug(char* f,T x,Ar... y){while(*f!=',') cerr<<*f++;cerr<<'='<<x<<",";_debug(f+1,y...);}
#ifdef LOCAL
#define gdb(...) _debug((char*)#__VA_ARGS__,__VA_ARGS__)
#else
#define gdb(...) void()
#endif
}using namespace Debug;
vector<int> A;
int n,w;
int check(int x,int y,int z){
swap(A[x],A[y]);swap(A[y],A[z]);
int sw=query(A);
swap(A[y],A[z]);swap(A[x],A[y]);
return sw==n-3;
}
void solve(int nn) {
n=nn;A.resize(n);
iota(all(A),0);
w=query(A);
for(int i=1;i<n;i++){
swap(A[i],A[1]);
int sw=query(A);
if(sw<w) swap(A[i],A[1]);
else w=sw;
}
for(int i=0;i<n;i++) gdb(A[i]);
vector<int> B;
B.push_back(0);
for(int i=1;i<n;i++){
int l=0,r=B.size(),mid;
while(l+1<r) mid=l+r>>1,(check(B[0],B[mid],i)?l:r)=mid;
B.insert(B.begin()+r,i);
}
for(int i=0;i<n;i++) gdb(B[i]);
vector<int> C(n);
int x=0;
for(int i=0;i<n;i++){
auto it=++find(all(B),i);
if(it==B.end()) it=B.begin();
C[i]=A[*it];
}
answer(C);
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3832kb
input:
2 0 0
output:
? 0 1 ? 0 1 ! 1 0 -
result:
wrong answer Wrong Answer [8]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%