QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#855171#8629. 寻宝lupengheyydsCompile Error//C++141.2kb2025-01-12 15:45:492025-01-12 15:45:50

Judging History

This is the latest submission verdict.

  • [2025-01-12 15:45:50]
  • Judged
  • [2025-01-12 15:45:49]
  • Submitted

answer

#include"treasure.h"
#include<bits/stdc++.h>
const int NN=1e6+5;
int dep[NN];
vector<int> ed[NN];
queue<int> q;
void BFS(int x){
	q.push(x);
	dep[x]=1;
	while(!q.empty()){
		int x=q.front();q.pop();
		for(int y:ed[x]){
			if(dep[y])continue;
			dep[y]=dep[x]+1;
			q.push(y);
		}
	}
	return;
}
void Alice(const int testid, const int n, const int m, const int x, const int u[], const int v[], bool dir[]){
    for(int i=0;i<m;i++){
    	ed[u[i]].push_back(v[i]);
    	ed[v[i]].push_back(u[i]);
	}
	BFS(x);
	for(int i=0;i<m;i++){
		if(max(dep[v[i]],dep[u[i]])<=2500){
			if(dep[u[i]]<dep[v[i]])dir[i]=1;
			else dir[i]=0;
		}else{
			if(dep[u[i]]&1)dir[i]=1;
			else dir[i]=0;
		}
	}
	return;
}
typedef pair<int,bool> pa;
bool vst[NN];
unordered_map<int,vector<pa> > mp;
int Bob(const int testid, const int n){
	mt19937 rnd(time(0));
	int p=rnd()%n;
	while(1){
		p=rnd()%n;
		if(mp.find(p)=!=mp.end()){
			continue;
		}
		int in=0,out=0;
		for(pa eg:mp[p])eg.second?in++:out++;
		if(in&&out)break;
	}
	return 0;
	while(1){
		if(mp.find(p)==mp.end())mp[p] = discover(p);
    	bool d=0;
	    for(pa eg:mp[p])
	    	if(!eg.second){p=eg.first;d=1;break;}
	    if(!d)break;
	}
	mark:;
	return p;
}

详细

answer.code: In function ‘int Bob(int, int)’:
answer.code:45:31: error: expected primary-expression before ‘!=’ token
   45 |                 if(mp.find(p)=!=mp.end()){
      |                               ^~