Submission #288897

# Submission time Handle Problem Language Result Execution time Memory
288897 2020-09-02T06:33:39 Z mohammedehab2002 Stray Cat (JOI20_stray) C++17
Compilation error
0 ms 0 KB
#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;
}

Compilation message

/tmp/ccRSn6gc.o: In function `main':
grader_anthony.cpp:(.text.startup+0x16f): undefined reference to `Mark(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status