Submission #246343

# Submission time Handle Problem Language Result Execution time Memory
246343 2020-07-08T18:10:55 Z kostia244 Stray Cat (JOI20_stray) C++17
Compilation error
0 ms 0 KB
#include "Catherine.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;

namespace kate {

int A, B, gg = 0, lst = -2;
string cur, god = "110100110100";
int decide(vector<int> c) {
	if(c[0] + c[1] == 0) {
		gg = 1;
		return -1;
	}
	if(lst == -2 && c[0]+c[1] == 1) {
		gg = 1;
		return lst = c[1];
	}
	if(c[0] + c[1] + (lst != -2) > 2) {
		gg = 1;
		if(c[0] == 0) return -1;
		if(c[1] == 0) return -1;
		if(c[0] == 1) return lst = 0;
		if(c[1] == 1) return lst = 1;
		exit(-1);
	}
	if(c[0] + c[1] == 2) {
		if(c[0]) {
			cur.pb('0'+c[1]);
			cur.pb('0');
			return lst = 0;
		}
		cur += "11";
		return lst = 1;
	}
	if(gg) return lst = c[1];
	cur.pb('0'+c[1]);
	if(cur.size() == 5) {
		gg = 1;
		//cout << " " << gg << "Yay\n";
		if(god.find(cur) != string::npos) return -1;
	}
	return lst = c[1];
}


}  // namespace

void Init(int A, int B) {
	kate::A = A;
	kate::B = B;
}

int Move(std::vector<int> y) {
	//cout << y[0] << " " << y[1] << " go ";
	int t = kate::decide(y);
	//cout <<kate::cur << " " << t << endl;
	return t;
}
#include "Catherine.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;

namespace kate {

int A, B, gg = 0, lst = -2;
string cur, god = "110100110100";
int decide(vector<int> c) {
	if(c[0] + c[1] == 0) {
		gg = 1;
		return -1;
	}
	if(lst == -2 && c[0]+c[1] == 1) {
		gg = 1;
		return lst = c[1];
	}
	if(c[0] + c[1] + (lst != -2) > 2) {
		gg = 1;
		if(c[0] == 0) return -1;
		if(c[1] == 0) return -1;
		if(c[0] == 1) return lst = 0;
		if(c[1] == 1) return lst = 1;
		exit(-1);
	}
	if(c[0] + c[1] == 2) {
		if(c[0]) {
			cur.pb('0'+c[1]);
			cur.pb('0');
			return lst = 0;
		}
		cur += "11";
		return lst = 1;
	}
	if(gg) return lst = c[1];
	cur.pb('0'+c[1]);
	if(cur.size() == 5) {
		gg = 1;
		//cout << " " << gg << "Yay\n";
		if(god.find(cur) != string::npos) return -1;
	}
	return lst = c[1];
}


}  // namespace

void Init(int A, int B) {
	kate::A = A;
	kate::B = B;
}

int Move(std::vector<int> y) {
	//cout << y[0] << " " << y[1] << " go ";
	int t = kate::decide(y);
	//cout <<kate::cur << " " << t << endl;
	return t;
}

Compilation message

/tmp/cc7DCUtv.o: In function `main':
grader_anthony.cpp:(.text.startup+0x175): 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