제출 #262515

#제출 시각아이디문제언어결과실행 시간메모리
262515arnold518길고양이 (JOI20_stray)C++14
15 / 100
71 ms16904 KiB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static const int MAXN = 2e4;

static int N, M, A, B, D[MAXN+10];
static pii E[MAXN+10];
static vector<pii> adj[MAXN+10];
static vector<int> ret;

vector<int> Mark(int _N, int _M, int _A, int _B, vector<int> _U, vector<int> _V)
{
	N=_N; M=_M; A=_A; B=_B;
	for(int i=1; i<=M; i++)
	{
		int u=_U[i-1]+1, v=_V[i-1]+1;
		adj[u].push_back({v, i});
		adj[v].push_back({u, i});
		E[i]={u, v};
	}
	ret.resize(M);

	queue<int> Q;
	memset(D, -1, sizeof(D));
	Q.push(1); D[1]=0;
	while(!Q.empty())
	{
		int now=Q.front(); Q.pop();
		for(auto nxt : adj[now])
		{
			if(D[nxt.first]!=-1) continue;
			Q.push(nxt.first);
			D[nxt.first]=D[now]+1;
		}
	}

	if(B==0)
	{
		for(int i=1; i<=M; i++) ret[i-1]=min(D[E[i].first], D[E[i].second])%3;
		return ret;
	}

	for(int i=1; i<=M; i++) ret[i-1]=min(D[E[i].first], D[E[i].second])%2;
	return ret;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static const int MAXN = 2e4;
static int A, B;
static vector<int> V;
static int cnt=0;

void Init(int _A, int _B)
{
	A=_A; B=_B;
	cnt=0;
}

int Move(vector<int> _V)
{
	V=_V;

	if(B==0)
	{
		if(V[0]==0 && V[1]==0) return 2;
		if(V[0]==0 && V[2]==0) return 1;
		if(V[2]==0 && V[1]==0) return 0;

		if(V[0]==0) return 1;
		if(V[1]==0) return 2;
		if(V[2]==0) return 0;
	}

	if(V[0]==0 && V[1]==0) return -1;
	if(V[0]==1) return 0;
	if(V[1]==1) return 1;
}

컴파일 시 표준 에러 (stderr) 메시지

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...