Submission #286423

# Submission time Handle Problem Language Result Execution time Memory
286423 2020-08-30T11:31:30 Z TadijaSebez Stray Cat (JOI20_stray) C++14
0 / 100
60 ms 17720 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back

namespace {
	const int N=100050;
	int dist[N];
	vector<int> E[N];
	void AddEdge(int u,int v){E[u].pb(v);E[v].pb(u);}
	void BFS(int n,int m){
		queue<int> q;
		q.push(0);dist[0]=1;
		while(q.size()){
			int u=q.front();
			q.pop();
			for(int v:E[u])if(!dist[v]){
				dist[v]=dist[u]+1;
				q.push(v);
			}
		}
	}
	vector<int> Solve(int n,int m,vector<int> u,vector<int> v){
		vector<int> col;
		for(int i=0;i<m;i++){
			int a=u[i],b=v[i];
			if(dist[a]>dist[b])swap(a,b);
			if(dist[a]==dist[b])col.pb((dist[b]+1)%3);
			else col.pb(dist[b]%3);
		}
		return col;
	}
}  // namespace

vector<int> Mark(int n,int m,int a,int b,vector<int> u,vector<int> v){
	for(int i=0;i<m;i++)::AddEdge(u[i],v[i]);
	::BFS(n,m);
	return ::Solve(n,m,u,v);
}
#include "Catherine.h"
#include <vector>

namespace {
	int a,b,now;
	bool fir;
}  // namespace

void Init(int a,int b){
	::a=a;
	::b=b;
	::fir=1;
}

int Move(std::vector<int> y){
	if(::fir==1){
		::fir=0;
		int cnt=0;
		for(int i=0;i<3;i++)if(y[i]==0)cnt++;
		if(cnt<2){
			for(int i=0;i<3;i++)if(y[i]!=0)::now=i;
		}else{
			if(y[0]==0)::now=1;
			else if(y[1]==0)::now=2;
			else ::now=0;
		}
		return ::now;
	}else{
		::now=(::now+2)%3;
		return ::now;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 17720 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 17720 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 15540 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 15540 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 5456 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 8960 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 8704 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -