답안 #925945

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
925945 2024-02-12T11:18:40 Z mickey080929 길고양이 (JOI20_stray) C++17
15 / 100
38 ms 19568 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 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 15268 KB Output is correct
2 Correct 1 ms 1296 KB Output is correct
3 Correct 23 ms 15420 KB Output is correct
4 Correct 33 ms 17156 KB Output is correct
5 Correct 36 ms 17140 KB Output is correct
6 Correct 28 ms 15612 KB Output is correct
7 Correct 27 ms 15684 KB Output is correct
8 Correct 32 ms 16452 KB Output is correct
9 Correct 35 ms 16464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 35 ms 15268 KB Output is correct
2 Correct 1 ms 1296 KB Output is correct
3 Correct 23 ms 15420 KB Output is correct
4 Correct 33 ms 17156 KB Output is correct
5 Correct 36 ms 17140 KB Output is correct
6 Correct 28 ms 15612 KB Output is correct
7 Correct 27 ms 15684 KB Output is correct
8 Correct 32 ms 16452 KB Output is correct
9 Correct 35 ms 16464 KB Output is correct
10 Correct 27 ms 13980 KB Output is correct
11 Correct 27 ms 13632 KB Output is correct
12 Correct 25 ms 13976 KB Output is correct
13 Correct 25 ms 13896 KB Output is correct
14 Correct 26 ms 14116 KB Output is correct
15 Correct 28 ms 14340 KB Output is correct
16 Correct 30 ms 16564 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 12944 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 24 ms 13108 KB Output is correct
4 Correct 33 ms 14924 KB Output is correct
5 Correct 34 ms 14676 KB Output is correct
6 Correct 26 ms 13336 KB Output is correct
7 Correct 25 ms 13380 KB Output is correct
8 Correct 28 ms 14160 KB Output is correct
9 Correct 33 ms 14072 KB Output is correct
10 Correct 27 ms 13904 KB Output is correct
11 Correct 30 ms 13724 KB Output is correct
12 Correct 38 ms 13840 KB Output is correct
13 Correct 31 ms 13932 KB Output is correct
14 Correct 30 ms 14184 KB Output is correct
15 Correct 30 ms 14112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 12944 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 24 ms 13108 KB Output is correct
4 Correct 33 ms 14924 KB Output is correct
5 Correct 34 ms 14676 KB Output is correct
6 Correct 26 ms 13336 KB Output is correct
7 Correct 25 ms 13380 KB Output is correct
8 Correct 28 ms 14160 KB Output is correct
9 Correct 33 ms 14072 KB Output is correct
10 Correct 27 ms 13904 KB Output is correct
11 Correct 30 ms 13724 KB Output is correct
12 Correct 38 ms 13840 KB Output is correct
13 Correct 31 ms 13932 KB Output is correct
14 Correct 30 ms 14184 KB Output is correct
15 Correct 30 ms 14112 KB Output is correct
16 Correct 23 ms 11844 KB Output is correct
17 Correct 28 ms 11716 KB Output is correct
18 Correct 24 ms 11920 KB Output is correct
19 Correct 24 ms 11912 KB Output is correct
20 Correct 27 ms 12548 KB Output is correct
21 Correct 26 ms 12304 KB Output is correct
22 Correct 28 ms 14416 KB Output is correct
23 Correct 24 ms 11892 KB Output is correct
24 Correct 28 ms 12100 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 1824 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 26 ms 19568 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 11252 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -