Submission #1078130

#TimeUsernameProblemLanguageResultExecution timeMemory
1078130mindiyakCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "plants.h"
#include <iostream>
using namespace std;

vector<int> R;

void init(int k, std::vector<int> r) {
	R = r;
	return;
}

int compare_plants(int x, int y) {
	int a=x;
	int n = R.size();
	// cerr << x << " " << y << endl;

	a = x;
	if(R[a] == 0){
		a += 1;
		while((a%n) != y && R[(a%n)] == 0)a++;
		// cerr << "X - " << (a%n) << " -1" << endl;
		if((a%n) == y) return 1;
	}
	a = y;
	if(R[a] == 1){
		a += 1;
		while((a%n) != x && R[(a%n)] == 1)a++;
		// cerr << "X - " << (a%n) << " -1" << endl;
		if((a%n) == x) return 1;
	}


	a = y;
	if(R[a] == 0){
		a += 1;
		while((a%n) != x && R[(a%n)] == 0)a++;
		// cerr << "X - " << (a%n) << " -1" << endl;
		if((a%n) == x) return -1;
	}
	a = x;
	if(R[a] == 1){
		a += 1;
		while((a%n) != y && R[(a%n)] == 1)a++;
		// cerr << "X - " << (a%n) << " -1" << endl;
		if((a%n) == y) return -1;
	}
	
	return 0;
}

Compilation message (stderr)

tickets.cpp:1:10: fatal error: plants.h: No such file or directory
    1 | #include "plants.h"
      |          ^~~~~~~~~~
compilation terminated.