#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])
{
l^=1;
return l;
}
return -1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
16268 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
16268 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
13692 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
40 ms |
12984 KB |
Output is correct |
4 |
Correct |
64 ms |
16072 KB |
Output is correct |
5 |
Correct |
67 ms |
16088 KB |
Output is correct |
6 |
Correct |
46 ms |
14024 KB |
Output is correct |
7 |
Incorrect |
45 ms |
14028 KB |
Wrong Answer [6] |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
13692 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
40 ms |
12984 KB |
Output is correct |
4 |
Correct |
64 ms |
16072 KB |
Output is correct |
5 |
Correct |
67 ms |
16088 KB |
Output is correct |
6 |
Correct |
46 ms |
14024 KB |
Output is correct |
7 |
Incorrect |
45 ms |
14028 KB |
Wrong Answer [6] |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1536 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 |
3 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 |
2048 KB |
Output is correct |
10 |
Correct |
2 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 |
1792 KB |
Output is correct |
17 |
Correct |
2 ms |
1536 KB |
Output is correct |
18 |
Correct |
2 ms |
1792 KB |
Output is correct |
19 |
Correct |
2 ms |
1552 KB |
Output is correct |
20 |
Correct |
3 ms |
1792 KB |
Output is correct |
21 |
Correct |
2 ms |
1792 KB |
Output is correct |
22 |
Correct |
2 ms |
1792 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 |
1536 KB |
Output is correct |
28 |
Correct |
2 ms |
1792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
43 ms |
11488 KB |
Output is correct |
2 |
Correct |
50 ms |
13012 KB |
Output is correct |
3 |
Correct |
1 ms |
1536 KB |
Output is correct |
4 |
Correct |
36 ms |
11560 KB |
Output is correct |
5 |
Correct |
57 ms |
14544 KB |
Output is correct |
6 |
Correct |
58 ms |
14552 KB |
Output is correct |
7 |
Correct |
46 ms |
13524 KB |
Output is correct |
8 |
Correct |
45 ms |
13656 KB |
Output is correct |
9 |
Correct |
58 ms |
14540 KB |
Output is correct |
10 |
Correct |
63 ms |
14684 KB |
Output is correct |
11 |
Correct |
56 ms |
14420 KB |
Output is correct |
12 |
Correct |
59 ms |
14540 KB |
Output is correct |
13 |
Correct |
57 ms |
14540 KB |
Output is correct |
14 |
Correct |
60 ms |
14548 KB |
Output is correct |
15 |
Correct |
57 ms |
14548 KB |
Output is correct |
16 |
Correct |
59 ms |
14556 KB |
Output is correct |
17 |
Correct |
53 ms |
14172 KB |
Output is correct |
18 |
Correct |
60 ms |
14424 KB |
Output is correct |
19 |
Correct |
54 ms |
14156 KB |
Output is correct |
20 |
Correct |
56 ms |
14168 KB |
Output is correct |
21 |
Correct |
53 ms |
14168 KB |
Output is correct |
22 |
Correct |
53 ms |
14164 KB |
Output is correct |
23 |
Correct |
43 ms |
11732 KB |
Output is correct |
24 |
Correct |
44 ms |
11864 KB |
Output is correct |
25 |
Correct |
44 ms |
12492 KB |
Output is correct |
26 |
Correct |
44 ms |
12356 KB |
Output is correct |
27 |
Correct |
50 ms |
13136 KB |
Output is correct |
28 |
Correct |
50 ms |
13128 KB |
Output is correct |
29 |
Correct |
50 ms |
13164 KB |
Output is correct |
30 |
Correct |
53 ms |
13260 KB |
Output is correct |
31 |
Correct |
43 ms |
11764 KB |
Output is correct |
32 |
Incorrect |
40 ms |
11860 KB |
Wrong Answer [6] |
33 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
11480 KB |
Output is correct |
2 |
Correct |
45 ms |
12420 KB |
Output is correct |
3 |
Correct |
1 ms |
1536 KB |
Output is correct |
4 |
Correct |
38 ms |
11636 KB |
Output is correct |
5 |
Correct |
57 ms |
14544 KB |
Output is correct |
6 |
Correct |
62 ms |
14576 KB |
Output is correct |
7 |
Correct |
45 ms |
13540 KB |
Output is correct |
8 |
Correct |
45 ms |
13656 KB |
Output is correct |
9 |
Correct |
56 ms |
14568 KB |
Output is correct |
10 |
Correct |
57 ms |
14560 KB |
Output is correct |
11 |
Correct |
59 ms |
14568 KB |
Output is correct |
12 |
Correct |
57 ms |
14548 KB |
Output is correct |
13 |
Correct |
63 ms |
14412 KB |
Output is correct |
14 |
Correct |
57 ms |
14412 KB |
Output is correct |
15 |
Incorrect |
56 ms |
14544 KB |
Wrong Answer [6] |
16 |
Halted |
0 ms |
0 KB |
- |