Submission #1077383

# Submission time Handle Problem Language Result Execution time Memory
1077383 2024-08-27T06:28:25 Z mindiyak Comparing Plants (IOI20_plants) C++14
0 / 100
1 ms 348 KB
#include "plants.h"
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();
	if(R[a] == 1){
		a += 1;
		while((a%n) != y && R[(a%n)] == 0)a++;
		if((a%n) == y) return 1;
	}
	a = y;
	if(R[a] == 1){
		a += 1;
		while((a%n) != x && R[(a%n)] == 0)a++;
		if((a%n) == x) return -1;
	}
	
	return 0;
}

# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -