답안 #262518

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
262518 2020-08-13T02:42:43 Z arnold518 길고양이 (JOI20_stray) C++14
20 / 100
69 ms 17020 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, bef;

void Init(int _A, int _B)
{
	A=_A; B=_B;
	cnt=0; bef=-1;
	srand(time(NULL));
}

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

	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(cnt==1)
	{
		if(V[0]==1 && V[1]!=1) return bef=0;
		if(V[1]==1 && V[0]!=1) return bef=1;
		if(V[0]==1 && V[1]==1) return bef=rand()%2;
	}
	else
	{
		if(V[0]==0 && V[1]==0) return -1;
		bef=!bef;
		return bef;
	}

}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 15824 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 42 ms 15224 KB Output is correct
4 Correct 69 ms 17020 KB Output is correct
5 Correct 67 ms 16884 KB Output is correct
6 Correct 56 ms 15604 KB Output is correct
7 Correct 58 ms 15760 KB Output is correct
8 Correct 60 ms 16488 KB Output is correct
9 Correct 58 ms 16460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 15824 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 42 ms 15224 KB Output is correct
4 Correct 69 ms 17020 KB Output is correct
5 Correct 67 ms 16884 KB Output is correct
6 Correct 56 ms 15604 KB Output is correct
7 Correct 58 ms 15760 KB Output is correct
8 Correct 60 ms 16488 KB Output is correct
9 Correct 58 ms 16460 KB Output is correct
10 Correct 44 ms 13816 KB Output is correct
11 Correct 47 ms 13884 KB Output is correct
12 Correct 44 ms 13688 KB Output is correct
13 Correct 45 ms 13680 KB Output is correct
14 Correct 47 ms 14072 KB Output is correct
15 Correct 57 ms 14328 KB Output is correct
16 Correct 58 ms 16388 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 13428 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 39 ms 13052 KB Output is correct
4 Correct 60 ms 14580 KB Output is correct
5 Correct 61 ms 14720 KB Output is correct
6 Correct 55 ms 13512 KB Output is correct
7 Correct 53 ms 13440 KB Output is correct
8 Correct 61 ms 14204 KB Output is correct
9 Correct 59 ms 14208 KB Output is correct
10 Correct 64 ms 13940 KB Output is correct
11 Correct 63 ms 13812 KB Output is correct
12 Correct 53 ms 13948 KB Output is correct
13 Correct 55 ms 13948 KB Output is correct
14 Correct 56 ms 14276 KB Output is correct
15 Correct 69 ms 14532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 13428 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 39 ms 13052 KB Output is correct
4 Correct 60 ms 14580 KB Output is correct
5 Correct 61 ms 14720 KB Output is correct
6 Correct 55 ms 13512 KB Output is correct
7 Correct 53 ms 13440 KB Output is correct
8 Correct 61 ms 14204 KB Output is correct
9 Correct 59 ms 14208 KB Output is correct
10 Correct 64 ms 13940 KB Output is correct
11 Correct 63 ms 13812 KB Output is correct
12 Correct 53 ms 13948 KB Output is correct
13 Correct 55 ms 13948 KB Output is correct
14 Correct 56 ms 14276 KB Output is correct
15 Correct 69 ms 14532 KB Output is correct
16 Correct 40 ms 11904 KB Output is correct
17 Correct 50 ms 11860 KB Output is correct
18 Correct 46 ms 12052 KB Output is correct
19 Correct 46 ms 11960 KB Output is correct
20 Correct 51 ms 12528 KB Output is correct
21 Correct 47 ms 12364 KB Output is correct
22 Correct 64 ms 14204 KB Output is correct
23 Correct 50 ms 12256 KB Output is correct
24 Correct 51 ms 12056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1792 KB Output is correct
2 Correct 1 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 Correct 2 ms 1792 KB Output is correct
13 Correct 2 ms 1792 KB Output is correct
14 Correct 2 ms 1792 KB Output is correct
15 Correct 2 ms 1792 KB Output is correct
16 Correct 2 ms 1792 KB Output is correct
17 Correct 2 ms 1792 KB Output is correct
18 Correct 2 ms 1792 KB Output is correct
19 Correct 2 ms 1792 KB Output is correct
20 Correct 2 ms 1792 KB Output is correct
21 Correct 2 ms 1792 KB Output is correct
22 Correct 2 ms 2048 KB Output is correct
23 Correct 2 ms 1792 KB Output is correct
24 Correct 2 ms 1792 KB Output is correct
25 Correct 2 ms 1792 KB Output is correct
26 Correct 2 ms 1792 KB Output is correct
27 Correct 2 ms 1792 KB Output is correct
28 Correct 3 ms 1856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 40 ms 11636 KB Output is correct
2 Correct 47 ms 12712 KB Output is correct
3 Correct 2 ms 1792 KB Output is correct
4 Correct 37 ms 11816 KB Output is correct
5 Correct 58 ms 13644 KB Output is correct
6 Correct 56 ms 13692 KB Output is correct
7 Correct 48 ms 12628 KB Output is correct
8 Incorrect 41 ms 12628 KB Wrong Answer [6]
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 44 ms 11644 KB Output is correct
2 Correct 47 ms 12028 KB Output is correct
3 Correct 2 ms 1792 KB Output is correct
4 Correct 38 ms 11828 KB Output is correct
5 Correct 62 ms 13700 KB Output is correct
6 Correct 61 ms 13580 KB Output is correct
7 Correct 47 ms 12808 KB Output is correct
8 Incorrect 45 ms 12792 KB Wrong Answer [6]
9 Halted 0 ms 0 KB -