Submission #260915

# Submission time Handle Problem Language Result Execution time Memory
260915 2020-08-11T07:41:14 Z 송준혁(#5049) Stray Cat (JOI20_stray) C++17
76 / 100
73 ms 17644 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
	int S[6] = {1, 0, 0, 1, 0, 1};
	std::vector<int> adj[20202], id[20202];
	std::vector<int> X;
	void dfs(int u, int p, int c, int d){
		if (adj[u].size() == 2){
			for (int j=0; j<adj[u].size(); j++){
				if (adj[u][j] == p) continue;
				X[id[u][j]] = S[d];
				dfs(adj[u][j], u, S[d], (d+1)%6);
			}
			return;
		}
		for (int j=0; j<adj[u].size(); j++){
			if (adj[u][j] == p) continue;
			X[id[u][j]] = !c;
			dfs(adj[u][j], u, !c, !c?0:2);
		}
	}
}

std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) {
	X.resize(M);
	for (int i=0; i<M; i++){
		adj[U[i]].push_back(V[i]); 
		id[U[i]].push_back(i); 
		adj[V[i]].push_back(U[i]); 
		id[V[i]].push_back(i); 
	}
	dfs(0, -1, 1, 0);
	return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>

namespace {
	int st=0, pr=-1;
	int x=0;
}

void Init(int A, int B){}

int Move(std::vector<int> y) {
	if (st<0){
		st++;
		if (y[0] == 1) return pr=0;
		return pr=1;
	}
	if (y[0]+y[1] == 2){
		if (pr != -1){
			if (!y[0] || !y[1]) return -1;
			return pr=!pr;
		}
		st=1;
		if (y[0] && y[1]){x=2; return pr=1;}
		else if (y[0]){x=0; return pr=0;}
		else{x=3; return pr=1;}
	}
	if (y[0]+y[1]==1 && st==1){
		st=2;
		if (y[1] == 1){x|=4; return pr=1;}
		else return pr=0;
	}
	if (y[0]+y[1]==1 && st==2){
		st=3;
		if (y[1] == 1){x|=8; return pr=1;}
		else return pr=0;
	}
	if (y[0]+y[1]==1 && st==3){
		if (y[1] == 1) x|=16;
		if (x == 5 || x == 18 || x == 25 || x == 12 || x == 22 || x == 11){
			st = 0;
			if (y[1] == 1) return pr=1;
			return pr=0;
		}
		st=-2;
		return -1;
	}
	st=0;
	if (y[0] == 1) return pr=0;
	if (y[1] == 1) return pr=1;
	return -1;
}

Compilation message

Anthony.cpp: In function 'void {anonymous}::dfs(int, int, int, int)':
Anthony.cpp:11:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (int j=0; j<adj[u].size(); j++){
                  ~^~~~~~~~~~~~~~
Anthony.cpp:18:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j=0; j<adj[u].size(); j++){
                 ~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 17644 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 17644 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 49 ms 15048 KB Output is correct
2 Correct 1 ms 2560 KB Output is correct
3 Correct 44 ms 14300 KB Output is correct
4 Correct 73 ms 17176 KB Output is correct
5 Correct 68 ms 17296 KB Output is correct
6 Incorrect 49 ms 14880 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 49 ms 15048 KB Output is correct
2 Correct 1 ms 2560 KB Output is correct
3 Correct 44 ms 14300 KB Output is correct
4 Correct 73 ms 17176 KB Output is correct
5 Correct 68 ms 17296 KB Output is correct
6 Incorrect 49 ms 14880 KB Wrong Answer [6]
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2560 KB Output is correct
2 Correct 1 ms 2560 KB Output is correct
3 Correct 3 ms 2560 KB Output is correct
4 Correct 3 ms 2816 KB Output is correct
5 Correct 2 ms 2816 KB Output is correct
6 Correct 2 ms 2816 KB Output is correct
7 Correct 2 ms 2816 KB Output is correct
8 Correct 3 ms 2816 KB Output is correct
9 Correct 2 ms 2816 KB Output is correct
10 Correct 3 ms 2816 KB Output is correct
11 Correct 3 ms 2816 KB Output is correct
12 Correct 3 ms 2560 KB Output is correct
13 Correct 3 ms 2560 KB Output is correct
14 Correct 2 ms 2560 KB Output is correct
15 Correct 2 ms 2560 KB Output is correct
16 Correct 3 ms 2560 KB Output is correct
17 Correct 3 ms 2560 KB Output is correct
18 Correct 2 ms 2624 KB Output is correct
19 Correct 3 ms 2560 KB Output is correct
20 Correct 2 ms 2560 KB Output is correct
21 Correct 3 ms 2560 KB Output is correct
22 Correct 3 ms 2560 KB Output is correct
23 Correct 3 ms 2560 KB Output is correct
24 Correct 3 ms 2560 KB Output is correct
25 Correct 3 ms 2560 KB Output is correct
26 Correct 2 ms 2560 KB Output is correct
27 Correct 2 ms 2560 KB Output is correct
28 Correct 2 ms 2560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 12856 KB Output is correct
2 Correct 57 ms 13768 KB Output is correct
3 Correct 1 ms 2560 KB Output is correct
4 Correct 39 ms 12580 KB Output is correct
5 Correct 57 ms 15628 KB Output is correct
6 Correct 63 ms 15760 KB Output is correct
7 Correct 48 ms 14984 KB Output is correct
8 Correct 48 ms 14848 KB Output is correct
9 Correct 57 ms 15560 KB Output is correct
10 Correct 57 ms 15656 KB Output is correct
11 Correct 62 ms 15632 KB Output is correct
12 Correct 61 ms 15552 KB Output is correct
13 Correct 59 ms 15748 KB Output is correct
14 Correct 60 ms 15632 KB Output is correct
15 Correct 57 ms 15556 KB Output is correct
16 Correct 63 ms 15552 KB Output is correct
17 Correct 54 ms 15372 KB Output is correct
18 Correct 56 ms 15432 KB Output is correct
19 Correct 55 ms 15192 KB Output is correct
20 Correct 56 ms 15356 KB Output is correct
21 Correct 56 ms 15344 KB Output is correct
22 Correct 58 ms 15372 KB Output is correct
23 Correct 47 ms 12608 KB Output is correct
24 Correct 46 ms 12884 KB Output is correct
25 Correct 48 ms 13248 KB Output is correct
26 Correct 55 ms 13120 KB Output is correct
27 Correct 64 ms 14080 KB Output is correct
28 Correct 55 ms 14160 KB Output is correct
29 Correct 55 ms 14048 KB Output is correct
30 Correct 55 ms 14120 KB Output is correct
31 Correct 48 ms 12616 KB Output is correct
32 Correct 47 ms 12616 KB Output is correct
33 Correct 49 ms 13344 KB Output is correct
34 Correct 47 ms 13284 KB Output is correct
35 Correct 55 ms 13896 KB Output is correct
36 Correct 52 ms 14020 KB Output is correct
37 Correct 51 ms 13904 KB Output is correct
38 Correct 55 ms 13896 KB Output is correct
39 Correct 56 ms 13752 KB Output is correct
40 Correct 52 ms 14016 KB Output is correct
41 Correct 55 ms 14556 KB Output is correct
42 Correct 54 ms 14552 KB Output is correct
43 Correct 54 ms 14668 KB Output is correct
44 Correct 57 ms 14676 KB Output is correct
45 Correct 55 ms 14536 KB Output is correct
46 Correct 57 ms 14656 KB Output is correct
47 Correct 51 ms 13708 KB Output is correct
48 Correct 54 ms 13856 KB Output is correct
49 Correct 61 ms 13636 KB Output is correct
50 Correct 55 ms 13760 KB Output is correct
51 Correct 47 ms 12816 KB Output is correct
52 Correct 55 ms 12808 KB Output is correct
53 Correct 47 ms 12824 KB Output is correct
54 Correct 46 ms 12936 KB Output is correct
55 Correct 50 ms 12828 KB Output is correct
56 Correct 47 ms 12616 KB Output is correct
57 Correct 46 ms 13032 KB Output is correct
58 Correct 50 ms 12952 KB Output is correct
59 Correct 46 ms 13000 KB Output is correct
60 Correct 50 ms 13000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 12644 KB Output is correct
2 Incorrect 48 ms 13768 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -