QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#20103#2425. The Collection Gamewxp#Compile Error//C++201.4kb2022-02-14 19:22:322022-05-18 04:08:12

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-18 04:08:12]
  • 评测
  • [2022-02-14 19:22:32]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define per(i,x,y) for(int i=x;i>=y;--i)
#define lon long long
#define pb emplace_back
using namespace std;
const int n7=101234;
int dir[n7],a[n7],id[n7];

void work(int n,int NN){
	dir[1]=1;
	for(int len=1;len+len<=n;len<<=1){
		rep(i,len+1,len+len)dir[i]=!dir[i-len];
	}
	for(int len=2;len<=n;len<<=1){
		for(int lenz=len;lenz>1;lenz>>=1){
			rep(i,1,n){
				int L=1+(i-1)*len,R=i*len;
				if(R>n)break;
				rep(j,1,n){
					int l=L+(j-1)*lenz,r=L-1+j*lenz,mid=(l+r)>>1;
					if(r>R)break;
					rep(k,0,r-mid-1){
						if(mid+1+k>R)break;
						if(id[l+k]<=NN&&id[mid+1+k]<=NN)schedule(id[l+k],id[mid+1+k]);
					}
				}
			}
			vector <int> now=visit();
			int cnt=0;
			rep(i,1,n){
				int L=1+(i-1)*len,R=i*len;
				if(R>n)break;
				rep(j,1,n){
					int l=L+(j-1)*lenz,r=L-1+j*lenz,mid=(l+r)>>1;
					if(r>R)break;
					rep(k,0,r-mid-1){
						if(mid+1+k>R)break;
						if(id[l+k]>NN||id[mid+1+k]>NN){
							if(a[ id[l+k] ]<a[ id[mid+1+k] ]!=dir[i])swap(id[l+k],id[mid+1+k]);
							continue;
						}
						if( now[cnt]!=dir[i] )swap(id[l+k],id[mid+1+k]);
						cnt++;
					}
				}
			}		
		}
	}
}

void solve(int n,int fw){
	rep(i,1,n)a[i]=i,id[i]=i;
	int NN=n;n=1;
	while(n<NN)n<<=1;
	rep(i,NN+1,n)a[i]=1000000,id[i]=i;
	work(n,NN);
	vector <int> ans;
	rep(i,1,NN)ans.pb(a[ id[i] ]);
	answer(ans);
	return;
}

詳細信息

answer.code: In function ‘void work(int, int)’:
answer.code:25:81: error: ‘schedule’ was not declared in this scope
   25 |                                                 if(id[l+k]<=NN&&id[mid+1+k]<=NN)schedule(id[l+k],id[mid+1+k]);
      |                                                                                 ^~~~~~~~
answer.code:29:47: error: no matching function for call to ‘visit()’
   29 |                         vector <int> now=visit();
      |                                          ~~~~~^~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133,
                 from answer.code:1:
/usr/include/c++/11/variant:1740:5: note: candidate: ‘template<class _Visitor, class ... _Variants> constexpr decltype(auto) std::visit(_Visitor&&, _Variants&& ...)’
 1740 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
/usr/include/c++/11/variant:1740:5: note:   template argument deduction/substitution failed:
answer.code:29:47: note:   candidate expects at least 1 argument, 0 provided
   29 |                         vector <int> now=visit();
      |                                          ~~~~~^~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133,
                 from answer.code:1:
/usr/include/c++/11/variant:1777:5: note: candidate: ‘template<class _Res, class _Visitor, class ... _Variants> constexpr _Res std::visit(_Visitor&&, _Variants&& ...)’
 1777 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
/usr/include/c++/11/variant:1777:5: note:   template argument deduction/substitution failed:
answer.code:29:47: note:   candidate expects at least 1 argument, 0 provided
   29 |                         vector <int> now=visit();
      |                                          ~~~~~^~
answer.code: In function ‘void solve(int, int)’:
answer.code:60:9: error: ‘answer’ was not declared in this scope
   60 |         answer(ans);
      |         ^~~~~~