Submission #912752

# Submission time Handle Problem Language Result Execution time Memory
912752 2024-01-19T20:11:47 Z amirhoseinfar1385 Stray Cat (JOI20_stray) C++17
Compilation error
0 ms 0 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn=20000+10;
struct yal{
	int u,v,w;	
	int getad(int fu){
		return (fu^u^v);
	}
}alle[maxn];

namespace {
	int a,b,n,m,high[maxn];
}

vector<int>res;
vector<int>adj[maxn];

void bfs(int u){
	vector<int>bf;
	bf.push_back(u);
	int dis=1;
	while((int)bf.size()>0){
		for(auto x:bf){
			high[x]=dis;
		}
		vector<int>fake;
		for(auto x:bf){
			for(auto y:adj[x]){
				int v=alle[y].getad(x);
				if(high[v]==0){
					high[v]=dis+1;
					fake.push_back(v);
				}
			}
		}
		swap(fake,bf);
		dis++;
	}
}

vector<int> Mark(int N, int M, int A, int B,std::vector<int> U, std::vector<int> V) {
  	a=A;
  	b=B;
  	n=N;
  	m=M;
  	res.resize(m);
  	for(int i=0;i<m;i++){
 		alle[i].u=U[i];
 		alle[i].v=V[i]; 		
  		adj[alle[i].u].push_back(i);
  		adj[alle[i].v].push_back(i);
  	}
  	if(a>=3){
  		bfs(0);
  		for(int i=0;i<m;i++){
  			if(high[alle[i].u]==high[alle[i].v]){
  				res[i]=(high[alle[i].v]+1)%3;
  				continue;
  			}
  			if(high[alle[i].u]>high[alle[i].v]){
  				swap(alle[i].u,alle[i].v);
  			}
  			res[i]=high[alle[i].v]%3;
  		}
  		return res;
  	}
  	return res;
}



    

Compilation message

/usr/bin/ld: /tmp/cc88q6j3.o: in function `main':
grader_catherine.cpp:(.text.startup+0x41c): undefined reference to `Init(int, int)'
/usr/bin/ld: grader_catherine.cpp:(.text.startup+0xcfa): undefined reference to `Move(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status