답안 #288898

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
288898 2020-09-02T06:34:25 Z mohammedehab2002 길고양이 (JOI20_stray) C++17
76 / 100
60 ms 16252 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace
{
	int seq[]={1,0,1,1,0,0};
	vector<pair<int,int> > v[20005];
	vector<int> ans;
}
void dfs(int node,int p,int idx,int gp)
{
	int c=(int)v[node].size()-(p!=-1);
	for (auto u:v[node])
	{
		if (u.first!=p)
		{
			if (c==1)
			{
				ans[u.second]=seq[idx];
				dfs(u.first,node,(idx+1)%6,seq[idx]);
			}
			else
			{
				ans[u.second]=!gp;
				dfs(u.first,node,0,!gp);
			}
		}
	}
}
vector<int> Mark(int n,int m,int A,int B,vector<int> a,vector<int> b)
{
	for (int i=0;i<m;i++)
	{
		v[a[i]].push_back({b[i],i});
		v[b[i]].push_back({a[i],i});
	}
	ans.resize(m);
	dfs(0,-1,0,0);
	return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
namespace
{
	bool f;
	int l,seq[]={1,0,1,1,0,0};
	vector<int> p;
}
void Init(int A, int B){}
int Move(vector<int> y)
{
	if (!f)
	{
		f=1;
		bool b=(y[0]>y[1]);
		if (!y[b])
		b^=1;
		if (y[0]+y[1]==2)
		p.push_back(b);
		return l=b;
	}
	if (!y[0] && !y[1])
	{
		p.clear();
		return -1;
	}
	if (p.size()==6)
	{
		for (int i=0;i<6;i++)
		{
			bool eq=1;
			for (int j=0;j<6;j++)
			eq&=(p[(i+j)%6]==seq[j]);
			if (eq)
			{
				p.clear();
				return -1;
			}
		}
	}
	if (y[0]+y[1]==1)
	{
		p.push_back(y[1]);
		return l=y[1];
	}
	p.clear();
	if (!y[l])
	return -1;
	l^=1;
	return l;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 48 ms 16252 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 48 ms 16252 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 13692 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 39 ms 12988 KB Output is correct
4 Correct 60 ms 15740 KB Output is correct
5 Correct 60 ms 15860 KB Output is correct
6 Correct 46 ms 13512 KB Output is correct
7 Incorrect 43 ms 13504 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 13692 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 39 ms 12988 KB Output is correct
4 Correct 60 ms 15740 KB Output is correct
5 Correct 60 ms 15860 KB Output is correct
6 Correct 46 ms 13512 KB Output is correct
7 Incorrect 43 ms 13504 KB Wrong Answer [6]
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1792 KB Output is correct
2 Correct 1 ms 1536 KB Output is correct
3 Correct 2 ms 1536 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 3 ms 1792 KB Output is correct
11 Correct 3 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 1536 KB Output is correct
17 Correct 2 ms 1536 KB Output is correct
18 Correct 2 ms 1536 KB Output is correct
19 Correct 2 ms 1536 KB Output is correct
20 Correct 2 ms 1536 KB Output is correct
21 Correct 2 ms 1792 KB Output is correct
22 Correct 2 ms 1536 KB Output is correct
23 Correct 2 ms 1536 KB Output is correct
24 Correct 2 ms 1536 KB Output is correct
25 Correct 2 ms 1536 KB Output is correct
26 Correct 2 ms 1536 KB Output is correct
27 Correct 2 ms 1536 KB Output is correct
28 Correct 2 ms 1792 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 11476 KB Output is correct
2 Correct 47 ms 12536 KB Output is correct
3 Correct 2 ms 1536 KB Output is correct
4 Correct 37 ms 11256 KB Output is correct
5 Correct 55 ms 14300 KB Output is correct
6 Correct 56 ms 14292 KB Output is correct
7 Correct 45 ms 13528 KB Output is correct
8 Correct 48 ms 13536 KB Output is correct
9 Correct 57 ms 14500 KB Output is correct
10 Correct 55 ms 14288 KB Output is correct
11 Correct 57 ms 14424 KB Output is correct
12 Correct 57 ms 14204 KB Output is correct
13 Correct 59 ms 14424 KB Output is correct
14 Correct 60 ms 14420 KB Output is correct
15 Correct 59 ms 14420 KB Output is correct
16 Correct 56 ms 14204 KB Output is correct
17 Correct 53 ms 14028 KB Output is correct
18 Correct 53 ms 13912 KB Output is correct
19 Correct 52 ms 14028 KB Output is correct
20 Correct 53 ms 13820 KB Output is correct
21 Correct 55 ms 14168 KB Output is correct
22 Correct 53 ms 13988 KB Output is correct
23 Correct 43 ms 11492 KB Output is correct
24 Correct 43 ms 11480 KB Output is correct
25 Correct 44 ms 11772 KB Output is correct
26 Correct 46 ms 11976 KB Output is correct
27 Correct 52 ms 12664 KB Output is correct
28 Correct 52 ms 12688 KB Output is correct
29 Correct 51 ms 12796 KB Output is correct
30 Correct 51 ms 12796 KB Output is correct
31 Correct 43 ms 11628 KB Output is correct
32 Correct 43 ms 11468 KB Output is correct
33 Correct 43 ms 12348 KB Output is correct
34 Correct 43 ms 12480 KB Output is correct
35 Correct 49 ms 13140 KB Output is correct
36 Correct 49 ms 13004 KB Output is correct
37 Correct 51 ms 13120 KB Output is correct
38 Correct 48 ms 12984 KB Output is correct
39 Correct 49 ms 13132 KB Output is correct
40 Correct 49 ms 13132 KB Output is correct
41 Correct 52 ms 13676 KB Output is correct
42 Correct 53 ms 13524 KB Output is correct
43 Correct 53 ms 13684 KB Output is correct
44 Correct 55 ms 13804 KB Output is correct
45 Correct 54 ms 13808 KB Output is correct
46 Correct 53 ms 13808 KB Output is correct
47 Correct 48 ms 12756 KB Output is correct
48 Correct 49 ms 12972 KB Output is correct
49 Correct 46 ms 12756 KB Output is correct
50 Correct 49 ms 13088 KB Output is correct
51 Correct 44 ms 12116 KB Output is correct
52 Correct 45 ms 12480 KB Output is correct
53 Correct 44 ms 12328 KB Output is correct
54 Correct 43 ms 12332 KB Output is correct
55 Correct 44 ms 12336 KB Output is correct
56 Correct 45 ms 12236 KB Output is correct
57 Correct 44 ms 12364 KB Output is correct
58 Correct 44 ms 12200 KB Output is correct
59 Correct 45 ms 11988 KB Output is correct
60 Correct 44 ms 12008 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 11492 KB Output is correct
2 Correct 46 ms 12284 KB Output is correct
3 Correct 1 ms 1536 KB Output is correct
4 Correct 38 ms 11316 KB Output is correct
5 Correct 56 ms 14292 KB Output is correct
6 Correct 57 ms 14244 KB Output is correct
7 Correct 44 ms 13396 KB Output is correct
8 Correct 45 ms 13400 KB Output is correct
9 Correct 56 ms 14196 KB Output is correct
10 Correct 55 ms 14296 KB Output is correct
11 Correct 59 ms 14204 KB Output is correct
12 Correct 60 ms 14296 KB Output is correct
13 Correct 56 ms 14204 KB Output is correct
14 Correct 59 ms 14316 KB Output is correct
15 Incorrect 56 ms 14304 KB Wrong Answer [6]
16 Halted 0 ms 0 KB -