답안 #925941

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
925941 2024-02-12T11:16:07 Z mickey080929 길고양이 (JOI20_stray) C++17
컴파일 오류
0 ms 0 KB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

int seq[] = {1, 1, 0, 1, 0, 0};

vector<int> adj[20010];
int dist[20010];

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
	for (int i=0; i<M; i++) {
		adj[U[i]].push_back(V[i]);
		adj[V[i]].push_back(U[i]);
	}
	memset(dist, -1, sizeof(dist));
	queue<int> q;
	q.push(0);
	dist[0] = 0;
	while (!q.empty()) {
		int x = q.front();
		q.pop();
		for (auto &y : adj[x]) {
			if (dist[y] != -1) {
				dist[y] = dist[x] + 1;
				q.push(y);
			}
		}
	}
	vector<int> ret(M);
	if (A >= 3) {
		for (int i=0; i<M; i++) {
			ret[i] = min(dist[U[i]], dist[V[i]]) % 3;
			assert(ret[i]>=0 && ret[i]<A)
		}
	}
	else {
		for (int i=0; i<M; i++) {
			ret[i] = seq[min(dist[U[i]], dist[V[i]]) % 6];
		}
	}
	return ret;
}
#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) {
	if (A >= 3) {
		if (y[0] && y[1]) return 0;
		if (y[1] && y[2]) return 1;
		if (y[2] && y[0]) return 2;
		if (y[0]) return 0;
		if (y[1]) return 1;
		if (y[2]) return 2;
		assert(0);
	}

}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:35:3: error: expected ';' before '}' token
   35 |   }
      |   ^

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^