#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[0]+y[1]==2)
{
if (!y[b])
b^=1;
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 |
47 ms |
16252 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
47 ms |
16252 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
13820 KB |
Output is correct |
2 |
Incorrect |
1 ms |
1536 KB |
Wrong Answer [5] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
13820 KB |
Output is correct |
2 |
Incorrect |
1 ms |
1536 KB |
Wrong Answer [5] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
1536 KB |
Output is correct |
2 |
Correct |
2 ms |
1536 KB |
Output is correct |
3 |
Correct |
2 ms |
1536 KB |
Output is correct |
4 |
Incorrect |
2 ms |
1792 KB |
Wrong Answer [5] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
40 ms |
11492 KB |
Wrong Answer [5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
11484 KB |
Output is correct |
2 |
Correct |
48 ms |
12924 KB |
Output is correct |
3 |
Incorrect |
1 ms |
1536 KB |
Wrong Answer [5] |
4 |
Halted |
0 ms |
0 KB |
- |