제출 #260543

#제출 시각아이디문제언어결과실행 시간메모리
260543Saboon길고양이 (JOI20_stray)C++14
15 / 100
67 ms16920 KiB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

const int maxn = 20'000 + 10;

int h[maxn];
vector<int> g[maxn];
int Q[maxn], tail, head;

void bfs(int v){
	memset(h, -1, sizeof h);
	Q[head++] = v;
	h[v] = 0;
	while (tail < head){
		v = Q[tail++];
		for (auto u : g[v])
			if (h[u] == -1)
				h[u] = h[v]+1, Q[head++] = u;
	}
}

vector<int> Mark(int n, int m, int A, int B, vector<int> U, vector<int> V) {
	vector<int> X(m);
	if (A >= 3){
		for (int i = 0; i < m; i++){
			g[U[i]].push_back(V[i]);
			g[V[i]].push_back(U[i]);
		}
		bfs(0);
		for (int i = 0; i < m; i++){
			int v = V[i], u = U[i];
			if (h[v] == h[u])
				X[i] = h[v]%3;
			else
				X[i] = (max(h[v],h[u])+2)%3;
		}
		return X;
	}
}
#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

int A, B;

void Init(int a, int b) {
	A = a, B = b;
}

int Move(vector<int> y) {
	int a = -1, b = -1;
	for (int j = 0; j < A; ++j) {
		if (y[j] != 0){
			if (a == -1)
				a = j;
			else
				b = j;
		}
	}
	if (b == -1)
		return a;
	if (a+1 == b)
		return a;
	return b;
}

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

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...