Submission #444856

# Submission time Handle Problem Language Result Execution time Memory
444856 2021-07-15T15:40:26 Z kig9981 Stray Cat (JOI20_stray) C++17
15 / 100
64 ms 16868 KB
#include "Anthony.h"
#include <bits/stdc++.h>

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

vector<pair<int,int>> adj[20000];
int dist[20000];

std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) {
	vector<int> X(M,-1);
	queue<pair<int,int>> Q;
	memset(dist,-1,sizeof(dist));
	for(int i=0;i<M;i++) {
		adj[U[i]].emplace_back(V[i],i);
		adj[V[i]].emplace_back(U[i],i);
	}
	dist[0]=0;
	for(auto[n,t]: adj[0]) {
		dist[n]=1;
		Q.emplace(n,X[t]=0);
	}
	while(!Q.empty()) {
		auto[c,p]=Q.front();
		Q.pop();
		for(auto[n,t]: adj[c]) {
			if(dist[n]==-1) {
				dist[n]=dist[c]+1;
				if(A==2) {

				}
				else X[t]=min(dist[c],dist[n])%3;
				Q.emplace(n,X[t]);
			}
			else if(X[t]==-1) X[t]=min(dist[c],dist[n])%3;
		}
	}
	return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

int A, r;
bool d;

void Init(int A, int B) {
	::A = A;
	r=-1; d=false;
}

int Move(std::vector<int> y) {
	if(r!=-1) y[r]++;
	if(A==2) {

	}
	else {
		for(int i=0;i<3;i++) if(y[i]==0 && y[(i+1)%3]==0) return r=(i+2)%3;
		for(int i=0;i<3;i++) if(y[i]==0) return r=(i+1)%3;
	}
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 49 ms 15400 KB Output is correct
2 Correct 1 ms 1140 KB Output is correct
3 Correct 38 ms 15308 KB Output is correct
4 Correct 55 ms 16860 KB Output is correct
5 Correct 53 ms 16868 KB Output is correct
6 Correct 43 ms 15556 KB Output is correct
7 Correct 44 ms 15624 KB Output is correct
8 Correct 52 ms 16220 KB Output is correct
9 Correct 49 ms 16268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 15400 KB Output is correct
2 Correct 1 ms 1140 KB Output is correct
3 Correct 38 ms 15308 KB Output is correct
4 Correct 55 ms 16860 KB Output is correct
5 Correct 53 ms 16868 KB Output is correct
6 Correct 43 ms 15556 KB Output is correct
7 Correct 44 ms 15624 KB Output is correct
8 Correct 52 ms 16220 KB Output is correct
9 Correct 49 ms 16268 KB Output is correct
10 Correct 40 ms 13812 KB Output is correct
11 Correct 42 ms 13592 KB Output is correct
12 Correct 40 ms 13696 KB Output is correct
13 Correct 39 ms 13692 KB Output is correct
14 Correct 44 ms 14084 KB Output is correct
15 Correct 48 ms 14384 KB Output is correct
16 Correct 51 ms 16420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 41 ms 13028 KB Output is correct
2 Correct 1 ms 1056 KB Output is correct
3 Correct 34 ms 13072 KB Output is correct
4 Correct 64 ms 14692 KB Output is correct
5 Correct 53 ms 14612 KB Output is correct
6 Correct 41 ms 13452 KB Output is correct
7 Correct 42 ms 13352 KB Output is correct
8 Correct 49 ms 13944 KB Output is correct
9 Correct 49 ms 13980 KB Output is correct
10 Correct 57 ms 13836 KB Output is correct
11 Correct 46 ms 14016 KB Output is correct
12 Correct 46 ms 13744 KB Output is correct
13 Correct 47 ms 13724 KB Output is correct
14 Correct 47 ms 14148 KB Output is correct
15 Correct 47 ms 14124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 41 ms 13028 KB Output is correct
2 Correct 1 ms 1056 KB Output is correct
3 Correct 34 ms 13072 KB Output is correct
4 Correct 64 ms 14692 KB Output is correct
5 Correct 53 ms 14612 KB Output is correct
6 Correct 41 ms 13452 KB Output is correct
7 Correct 42 ms 13352 KB Output is correct
8 Correct 49 ms 13944 KB Output is correct
9 Correct 49 ms 13980 KB Output is correct
10 Correct 57 ms 13836 KB Output is correct
11 Correct 46 ms 14016 KB Output is correct
12 Correct 46 ms 13744 KB Output is correct
13 Correct 47 ms 13724 KB Output is correct
14 Correct 47 ms 14148 KB Output is correct
15 Correct 47 ms 14124 KB Output is correct
16 Correct 37 ms 11984 KB Output is correct
17 Correct 37 ms 11876 KB Output is correct
18 Correct 38 ms 11908 KB Output is correct
19 Correct 38 ms 11744 KB Output is correct
20 Correct 43 ms 12512 KB Output is correct
21 Correct 41 ms 12328 KB Output is correct
22 Correct 52 ms 14336 KB Output is correct
23 Correct 41 ms 11952 KB Output is correct
24 Correct 38 ms 12048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1132 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 2260 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 2296 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -