답안 #513222

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
513222 2022-01-17T04:16:49 Z 8e7 길고양이 (JOI20_stray) C++17
0 / 100
46 ms 15564 KB
#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
#define maxn 20005
#define pii pair<int, int>
using namespace std;
namespace {
	vector<int> adj[maxn];
	const int inf = 8e7;	
}; 

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]);
	queue<int> que;
	que.push(0);
	vector<int> X(M), d(M, inf);
	d[0] = 0;
	while (que.size()) {
		int cur = que.front();que.pop();
		for (int v:adj[cur]) {
			if (d[cur] + 1 < d[v]) {
				d[v] = d[cur] + 1;
				que.push(v);
			}
		}
	}
	for (int i = 0; i < M; ++i) {
		if (d[U[i]] > d[V[i]]) swap(U[i], V[i]);
		X[i] = d[U[i]] % 3;
	}
	return X;
}
#include "Catherine.h"
#include <vector>
using namespace std;

namespace {
	int A, B;
};  

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

int Move(vector<int> y) {
	int cnt = (y[0] ? 1 : 0) + (y[1] ? 1 : 0) + (y[2] ? 1 : 0);
	if (cnt == 1) {
		for (int i = 0;i < 3;i++) {
			if (y[i]) return i;
		}
	} else {
		if (y[0] && y[1]) return 0;
		else if (y[1] && y[2]) return 1;
		else if (y[2]) return 2;
	}
	return -1;
}
/*
7 6 2 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 15288 KB Output is correct
2 Correct 1 ms 1004 KB Output is correct
3 Correct 31 ms 14668 KB Output is correct
4 Correct 43 ms 15552 KB Output is correct
5 Incorrect 40 ms 15564 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 15288 KB Output is correct
2 Correct 1 ms 1004 KB Output is correct
3 Correct 31 ms 14668 KB Output is correct
4 Correct 43 ms 15552 KB Output is correct
5 Incorrect 40 ms 15564 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 12952 KB Output is correct
2 Correct 1 ms 1000 KB Output is correct
3 Correct 37 ms 12492 KB Output is correct
4 Correct 45 ms 13120 KB Output is correct
5 Incorrect 36 ms 13208 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 12952 KB Output is correct
2 Correct 1 ms 1000 KB Output is correct
3 Correct 37 ms 12492 KB Output is correct
4 Correct 45 ms 13120 KB Output is correct
5 Incorrect 36 ms 13208 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1000 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 2104 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 2156 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -