답안 #951458

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
951458 2024-03-22T02:11:10 Z weakweakweak 길고양이 (JOI20_stray) C++17
15 / 100
40 ms 31856 KB
#include "Anthony.h"
#include <vector>
#include <queue>

namespace {

int vis[510000] = {0}, dep[510000] = {0};
std::vector <int> e[510000];

}  // namespace

std::vector<int> Mark(int N, int M, int A, int B,
                      std::vector<int> U, std::vector<int> V) {
  	for (int i = 0; i < M; i++) {
		e[U[i]].push_back(V[i]);
		e[V[i]].push_back(U[i]);
	}
	std::vector<int> X(M);
  	if (A != 2) {
    	std::queue<int> q;
    	q.push(0); vis[0] = 1;
    	while (q.size()) {
			int i = q.front(); q.pop();
			for (int j : e[i]) {
				if (vis[j]) continue;
				vis[j] = 1;
				dep[j] = dep[i] + 1;
				q.push(j);
			}
    	}
    	for (int i = 0; i < M; i++) {
      		int u = U[i], v = V[i];
      		if (dep[u] > dep[v]) std::swap(u, v);
      		if (dep[u] + 1 == dep[v]) {
        		X[i] = dep[u] % 3;
      		}
      		else {
        		X[i] = (dep[v]) % 3; 
      		}
    	}
  	}
	// else X = solution2();
  	return X;
}
#include "Catherine.h"
#include <vector>

namespace {

int A, B;
int variable_example = 0;

}  // namespace

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

int Move(std::vector<int> y) {
  if (A != 2) {
    if (y[0] > 0 and y[1] > 0) return 0;
    if (y[1] > 0 and y[2] > 0) return 1;
    if (y[2] > 0 and y[0] > 0) return 2;
    if (y[0]) return 0;
    if (y[1]) return 1;
    if (y[2]) return 2;
  }
  return -1;
}

Compilation message

Catherine.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 30704 KB Output is correct
2 Correct 3 ms 16148 KB Output is correct
3 Correct 26 ms 30248 KB Output is correct
4 Correct 40 ms 31812 KB Output is correct
5 Correct 40 ms 31856 KB Output is correct
6 Correct 31 ms 30536 KB Output is correct
7 Correct 31 ms 30732 KB Output is correct
8 Correct 40 ms 31288 KB Output is correct
9 Correct 34 ms 31292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 30704 KB Output is correct
2 Correct 3 ms 16148 KB Output is correct
3 Correct 26 ms 30248 KB Output is correct
4 Correct 40 ms 31812 KB Output is correct
5 Correct 40 ms 31856 KB Output is correct
6 Correct 31 ms 30536 KB Output is correct
7 Correct 31 ms 30732 KB Output is correct
8 Correct 40 ms 31288 KB Output is correct
9 Correct 34 ms 31292 KB Output is correct
10 Correct 28 ms 28728 KB Output is correct
11 Correct 31 ms 28680 KB Output is correct
12 Correct 31 ms 28720 KB Output is correct
13 Correct 28 ms 28680 KB Output is correct
14 Correct 29 ms 29000 KB Output is correct
15 Correct 31 ms 29052 KB Output is correct
16 Correct 40 ms 31228 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 28208 KB Output is correct
2 Correct 4 ms 16164 KB Output is correct
3 Correct 26 ms 27732 KB Output is correct
4 Correct 35 ms 29500 KB Output is correct
5 Correct 38 ms 29856 KB Output is correct
6 Correct 29 ms 28228 KB Output is correct
7 Correct 31 ms 28244 KB Output is correct
8 Correct 32 ms 29004 KB Output is correct
9 Correct 32 ms 29000 KB Output is correct
10 Correct 33 ms 28568 KB Output is correct
11 Correct 31 ms 29072 KB Output is correct
12 Correct 31 ms 28704 KB Output is correct
13 Correct 32 ms 28684 KB Output is correct
14 Correct 32 ms 29000 KB Output is correct
15 Correct 33 ms 28960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 28208 KB Output is correct
2 Correct 4 ms 16164 KB Output is correct
3 Correct 26 ms 27732 KB Output is correct
4 Correct 35 ms 29500 KB Output is correct
5 Correct 38 ms 29856 KB Output is correct
6 Correct 29 ms 28228 KB Output is correct
7 Correct 31 ms 28244 KB Output is correct
8 Correct 32 ms 29004 KB Output is correct
9 Correct 32 ms 29000 KB Output is correct
10 Correct 33 ms 28568 KB Output is correct
11 Correct 31 ms 29072 KB Output is correct
12 Correct 31 ms 28704 KB Output is correct
13 Correct 32 ms 28684 KB Output is correct
14 Correct 32 ms 29000 KB Output is correct
15 Correct 33 ms 28960 KB Output is correct
16 Correct 25 ms 26696 KB Output is correct
17 Correct 27 ms 26700 KB Output is correct
18 Correct 31 ms 27080 KB Output is correct
19 Correct 27 ms 26752 KB Output is correct
20 Correct 30 ms 27460 KB Output is correct
21 Correct 30 ms 27196 KB Output is correct
22 Correct 32 ms 29248 KB Output is correct
23 Correct 28 ms 26952 KB Output is correct
24 Correct 28 ms 26812 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 14364 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 23884 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 23880 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -