Submission #925940

# Submission time Handle Problem Language Result Execution time Memory
925940 2024-02-12T11:12:20 Z mickey080929 Stray Cat (JOI20_stray) C++17
0 / 100
25 ms 10920 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;
		}
	}
	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

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2240 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2240 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2316 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2316 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1988 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 10868 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 10920 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -