QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#66554#5015. 树pzrCompile Error//C++14889b2022-12-08 21:33:572022-12-08 21:33:58

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-08 21:33:58]
  • 评测
  • [2022-12-08 21:33:57]
  • 提交

answer

#include<bits/stdc++.h>
#define N 2000
#define eb emplace_back
using namespace std;
vector<int>d[N],v;
int rt;
void solve(vector<int>a,vector<int>b){
	if(!a.size()||!b.size())return;
	if(a.size()==1){
		for(int i=0;i<b.size();i++) 
		answer(a[0],b[i]);return;
	}v.clear();
	vector<int>a1,b1;vector<pair<int,int>>s;
	for(int i=0;i<a.size();i++)
	if(rand()&1)v.eb(a[i]);
	for(int i=0;i<a.size();i++)s.eb(ask(a[i],v)+v.size(),a[i]);
	for(int i=0;i<b.size();i++)s.eb(ask(b[i],v),b[i]+1000);
	sort(s.begin(),s.end());
	for(int i=0;i<s.size();i++){
		if(i!=0&&s[i].first!=s[i-1].first)
		{solve(a1,b1);a1.clear();b1.clear();}
		if(s[i].second<=1000)a1.eb(s[i].second);
		else b1.eb(s[i].second-1000);
	}solve(a1,b1);
}
void solver(int n,int A,int B){
	rt=rand()%n+1;v.eb(rt);
	for(int i=1;i<=n;i++)
	d[ask(i,v)].eb(i);
	for(int i=0;i<n;i++)
	solve(d[i],d[i+1]);
} 

详细

implementer.cpp: In function ‘void regduj260135279::init()’:
implementer.cpp:32:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   32 |                 scanf("%d",&n);
      |                 ~~~~~^~~~~~~~~
implementer.cpp:45:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   45 |                         scanf("%d%d",&u,&v);
      |                         ~~~~~^~~~~~~~~~~~~~
answer.code: In function ‘void solve(std::vector<int>, std::vector<int>)’:
answer.code:11:17: error: ‘answer’ was not declared in this scope
   11 |                 answer(a[0],b[i]);return;
      |                 ^~~~~~
answer.code:16:41: error: ‘ask’ was not declared in this scope
   16 |         for(int i=0;i<a.size();i++)s.eb(ask(a[i],v)+v.size(),a[i]);
      |                                         ^~~
answer.code:17:41: error: ‘ask’ was not declared in this scope
   17 |         for(int i=0;i<b.size();i++)s.eb(ask(b[i],v),b[i]+1000);
      |                                         ^~~
answer.code: In function ‘void solver(int, int, int)’:
answer.code:29:11: error: ‘ask’ was not declared in this scope
   29 |         d[ask(i,v)].eb(i);
      |           ^~~