Submission #260542

# Submission time Handle Problem Language Result Execution time Memory
260542 2020-08-10T13:48:33 Z Saboon Stray Cat (JOI20_stray) C++14
4 / 100
73 ms 17316 KB
#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] = (min(h[v],h[u])+2)%3;
		}
		return X;
	}
	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;
}
# Verdict Execution time Memory Grader output
1 Correct 53 ms 16152 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 41 ms 15312 KB Output is correct
4 Correct 73 ms 17300 KB Output is correct
5 Correct 70 ms 17316 KB Output is correct
6 Correct 48 ms 15824 KB Output is correct
7 Correct 52 ms 16020 KB Output is correct
8 Correct 63 ms 16756 KB Output is correct
9 Correct 58 ms 16664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 53 ms 16152 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 41 ms 15312 KB Output is correct
4 Correct 73 ms 17300 KB Output is correct
5 Correct 70 ms 17316 KB Output is correct
6 Correct 48 ms 15824 KB Output is correct
7 Correct 52 ms 16020 KB Output is correct
8 Correct 63 ms 16756 KB Output is correct
9 Correct 58 ms 16664 KB Output is correct
10 Correct 44 ms 13896 KB Output is correct
11 Incorrect 43 ms 13920 KB Wrong Answer [6]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 13664 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 40 ms 13140 KB Output is correct
4 Correct 59 ms 15128 KB Output is correct
5 Correct 59 ms 14940 KB Output is correct
6 Correct 57 ms 13688 KB Output is correct
7 Correct 50 ms 13696 KB Output is correct
8 Correct 56 ms 14496 KB Output is correct
9 Correct 62 ms 14292 KB Output is correct
10 Correct 53 ms 14224 KB Output is correct
11 Correct 52 ms 14036 KB Output is correct
12 Correct 52 ms 14236 KB Output is correct
13 Correct 52 ms 14156 KB Output is correct
14 Correct 55 ms 14484 KB Output is correct
15 Correct 55 ms 14556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 13664 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 40 ms 13140 KB Output is correct
4 Correct 59 ms 15128 KB Output is correct
5 Correct 59 ms 14940 KB Output is correct
6 Correct 57 ms 13688 KB Output is correct
7 Correct 50 ms 13696 KB Output is correct
8 Correct 56 ms 14496 KB Output is correct
9 Correct 62 ms 14292 KB Output is correct
10 Correct 53 ms 14224 KB Output is correct
11 Correct 52 ms 14036 KB Output is correct
12 Correct 52 ms 14236 KB Output is correct
13 Correct 52 ms 14156 KB Output is correct
14 Correct 55 ms 14484 KB Output is correct
15 Correct 55 ms 14556 KB Output is correct
16 Incorrect 43 ms 12100 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1536 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 10576 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 10620 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -