Submission #603613

# Submission time Handle Problem Language Result Execution time Memory
603613 2022-07-24T08:56:05 Z Tigryonochekk Comparing Plants (IOI20_plants) C++17
0 / 100
1 ms 212 KB
#include <iostream>
#include "plants.h"
#include <vector>
using namespace std;
const int N = 5002;

int n;
int k;
vector<int> r;
int ans[N][N];

void init(int kip, vector<int> rib) {
	k = kip;
	r = rib;
	n = r.size();
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < i + k; j++) {
			if (r[i] + i >= r[j % n] + j) {
				ans[i][j % n] = -1;
				ans[j % n][i] = 1;
			}
			else if (r[i] - i <= r[j % n] - j) {
				ans[i][j % n] = 1;
				ans[j % n][i] = -1;
			}
		}
	}
	return;
}

int compare_plants(int x, int y) {
	if (n <= 5000 && 2 * k > n) 
		return ans[x][y];
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -