Submission #961575

# Submission time Handle Problem Language Result Execution time Memory
961575 2024-04-12T08:23:01 Z Gr1sen Comparing Plants (IOI20_plants) C++17
0 / 100
1 ms 436 KB
#include "plants.h"
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

#define vi vector<int>
#define vvi vector<vi>

vi R;

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

int compare_plants(int x, int y) {
	int a = R[x+1];
	for (int i = x+2; i <= y; i++) {
		if (R[i] != a) return 0;
	}
	return (a ? 1 : -1);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 436 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 432 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 436 KB Output isn't correct
4 Halted 0 ms 0 KB -