답안 #262515

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
262515 2020-08-13T02:38:32 Z arnold518 길고양이 (JOI20_stray) C++14
15 / 100
71 ms 16904 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static const int MAXN = 2e4;

static int N, M, A, B, D[MAXN+10];
static pii E[MAXN+10];
static vector<pii> adj[MAXN+10];
static vector<int> ret;

vector<int> Mark(int _N, int _M, int _A, int _B, vector<int> _U, vector<int> _V)
{
	N=_N; M=_M; A=_A; B=_B;
	for(int i=1; i<=M; i++)
	{
		int u=_U[i-1]+1, v=_V[i-1]+1;
		adj[u].push_back({v, i});
		adj[v].push_back({u, i});
		E[i]={u, v};
	}
	ret.resize(M);

	queue<int> Q;
	memset(D, -1, sizeof(D));
	Q.push(1); D[1]=0;
	while(!Q.empty())
	{
		int now=Q.front(); Q.pop();
		for(auto nxt : adj[now])
		{
			if(D[nxt.first]!=-1) continue;
			Q.push(nxt.first);
			D[nxt.first]=D[now]+1;
		}
	}

	if(B==0)
	{
		for(int i=1; i<=M; i++) ret[i-1]=min(D[E[i].first], D[E[i].second])%3;
		return ret;
	}

	for(int i=1; i<=M; i++) ret[i-1]=min(D[E[i].first], D[E[i].second])%2;
	return ret;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static const int MAXN = 2e4;
static int A, B;
static vector<int> V;
static int cnt=0;

void Init(int _A, int _B)
{
	A=_A; B=_B;
	cnt=0;
}

int Move(vector<int> _V)
{
	V=_V;

	if(B==0)
	{
		if(V[0]==0 && V[1]==0) return 2;
		if(V[0]==0 && V[2]==0) return 1;
		if(V[2]==0 && V[1]==0) return 0;

		if(V[0]==0) return 1;
		if(V[1]==0) return 2;
		if(V[2]==0) return 0;
	}

	if(V[0]==0 && V[1]==0) return -1;
	if(V[0]==1) return 0;
	if(V[1]==1) return 1;
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 15908 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 48 ms 15224 KB Output is correct
4 Correct 71 ms 16904 KB Output is correct
5 Correct 69 ms 16892 KB Output is correct
6 Correct 61 ms 15776 KB Output is correct
7 Correct 62 ms 15612 KB Output is correct
8 Correct 64 ms 16500 KB Output is correct
9 Correct 65 ms 16372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 15908 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 48 ms 15224 KB Output is correct
4 Correct 71 ms 16904 KB Output is correct
5 Correct 69 ms 16892 KB Output is correct
6 Correct 61 ms 15776 KB Output is correct
7 Correct 62 ms 15612 KB Output is correct
8 Correct 64 ms 16500 KB Output is correct
9 Correct 65 ms 16372 KB Output is correct
10 Correct 47 ms 13732 KB Output is correct
11 Correct 45 ms 13880 KB Output is correct
12 Correct 47 ms 13816 KB Output is correct
13 Correct 47 ms 13932 KB Output is correct
14 Correct 48 ms 14148 KB Output is correct
15 Correct 53 ms 14528 KB Output is correct
16 Correct 58 ms 16512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 13476 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 40 ms 13044 KB Output is correct
4 Correct 63 ms 14716 KB Output is correct
5 Correct 61 ms 14580 KB Output is correct
6 Correct 49 ms 13588 KB Output is correct
7 Correct 48 ms 13468 KB Output is correct
8 Correct 55 ms 14380 KB Output is correct
9 Correct 55 ms 14076 KB Output is correct
10 Correct 56 ms 13820 KB Output is correct
11 Correct 54 ms 13940 KB Output is correct
12 Correct 50 ms 14020 KB Output is correct
13 Correct 52 ms 13948 KB Output is correct
14 Correct 57 ms 14276 KB Output is correct
15 Correct 54 ms 14284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 13476 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 40 ms 13044 KB Output is correct
4 Correct 63 ms 14716 KB Output is correct
5 Correct 61 ms 14580 KB Output is correct
6 Correct 49 ms 13588 KB Output is correct
7 Correct 48 ms 13468 KB Output is correct
8 Correct 55 ms 14380 KB Output is correct
9 Correct 55 ms 14076 KB Output is correct
10 Correct 56 ms 13820 KB Output is correct
11 Correct 54 ms 13940 KB Output is correct
12 Correct 50 ms 14020 KB Output is correct
13 Correct 52 ms 13948 KB Output is correct
14 Correct 57 ms 14276 KB Output is correct
15 Correct 54 ms 14284 KB Output is correct
16 Correct 40 ms 11768 KB Output is correct
17 Correct 41 ms 11904 KB Output is correct
18 Correct 48 ms 12016 KB Output is correct
19 Correct 43 ms 11896 KB Output is correct
20 Correct 51 ms 12612 KB Output is correct
21 Correct 48 ms 12280 KB Output is correct
22 Correct 64 ms 14404 KB Output is correct
23 Correct 52 ms 11980 KB Output is correct
24 Correct 45 ms 12112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1792 KB Output is correct
2 Correct 2 ms 1792 KB Output is correct
3 Correct 2 ms 1792 KB Output is correct
4 Correct 2 ms 1792 KB Output is correct
5 Correct 2 ms 1792 KB Output is correct
6 Correct 2 ms 1792 KB Output is correct
7 Correct 2 ms 1792 KB Output is correct
8 Correct 2 ms 1792 KB Output is correct
9 Correct 2 ms 1792 KB Output is correct
10 Correct 2 ms 1792 KB Output is correct
11 Correct 2 ms 1792 KB Output is correct
12 Incorrect 2 ms 1792 KB Wrong Answer [6]
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 40 ms 11772 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 11868 KB Output is correct
2 Incorrect 48 ms 12428 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -