Submission #262512

# Submission time Handle Problem Language Result Execution time Memory
262512 2020-08-13T02:31:32 Z arnold518 Stray Cat (JOI20_stray) C++14
15 / 100
69 ms 17524 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;
		}
	}

	for(int i=1; i<=M; i++)
	{
		ret[i-1]=min(D[E[i].first], D[E[i].second])%3;
	}
	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;

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

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

	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;
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 54 ms 16340 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 41 ms 15996 KB Output is correct
4 Correct 64 ms 17428 KB Output is correct
5 Correct 69 ms 17524 KB Output is correct
6 Correct 48 ms 16020 KB Output is correct
7 Correct 49 ms 16284 KB Output is correct
8 Correct 63 ms 16844 KB Output is correct
9 Correct 61 ms 16956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 54 ms 16340 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 41 ms 15996 KB Output is correct
4 Correct 64 ms 17428 KB Output is correct
5 Correct 69 ms 17524 KB Output is correct
6 Correct 48 ms 16020 KB Output is correct
7 Correct 49 ms 16284 KB Output is correct
8 Correct 63 ms 16844 KB Output is correct
9 Correct 61 ms 16956 KB Output is correct
10 Correct 53 ms 14384 KB Output is correct
11 Correct 53 ms 14392 KB Output is correct
12 Correct 62 ms 14532 KB Output is correct
13 Correct 45 ms 14380 KB Output is correct
14 Correct 46 ms 14384 KB Output is correct
15 Correct 53 ms 15004 KB Output is correct
16 Correct 60 ms 17024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 13852 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 49 ms 13368 KB Output is correct
4 Correct 60 ms 15228 KB Output is correct
5 Correct 63 ms 15228 KB Output is correct
6 Correct 46 ms 14036 KB Output is correct
7 Correct 47 ms 13908 KB Output is correct
8 Correct 68 ms 14912 KB Output is correct
9 Correct 58 ms 14768 KB Output is correct
10 Correct 54 ms 14420 KB Output is correct
11 Correct 58 ms 14412 KB Output is correct
12 Correct 53 ms 14528 KB Output is correct
13 Correct 57 ms 14532 KB Output is correct
14 Correct 64 ms 14676 KB Output is correct
15 Correct 64 ms 14908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 13852 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 49 ms 13368 KB Output is correct
4 Correct 60 ms 15228 KB Output is correct
5 Correct 63 ms 15228 KB Output is correct
6 Correct 46 ms 14036 KB Output is correct
7 Correct 47 ms 13908 KB Output is correct
8 Correct 68 ms 14912 KB Output is correct
9 Correct 58 ms 14768 KB Output is correct
10 Correct 54 ms 14420 KB Output is correct
11 Correct 58 ms 14412 KB Output is correct
12 Correct 53 ms 14528 KB Output is correct
13 Correct 57 ms 14532 KB Output is correct
14 Correct 64 ms 14676 KB Output is correct
15 Correct 64 ms 14908 KB Output is correct
16 Correct 45 ms 12372 KB Output is correct
17 Correct 41 ms 12412 KB Output is correct
18 Correct 41 ms 12364 KB Output is correct
19 Correct 43 ms 12480 KB Output is correct
20 Correct 51 ms 13004 KB Output is correct
21 Correct 47 ms 12876 KB Output is correct
22 Correct 56 ms 14724 KB Output is correct
23 Correct 43 ms 12584 KB Output is correct
24 Correct 44 ms 12452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1792 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 4864 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 4864 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -