# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
288897 | mohammedehab2002 | Stray Cat (JOI20_stray) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
#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;
}