QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#695244#8812. Library 3275307894a0 0ms3832kbC++141.7kb2024-10-31 19:35:582024-10-31 19:35:58

Judging History

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

  • [2024-10-31 19:35:58]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3832kb
  • [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%