Submission #331974

# Submission time Handle Problem Language Result Execution time Memory
331974 2020-11-30T21:37:04 Z pggp Comparing Plants (IOI20_plants) C++14
0 / 100
1 ms 512 KB
#include <bits/stdc++.h>

using namespace std;

int K;
vector < int > R;
int n;
vector < int > order;
int ord;

void init(int k, vector < int > r){
	K = k;
	R = r;
	n = R.size();
	order.resize(n);

	for (int i = 0; i < n; ++i)
	{
		for(int ind = 0; ind < n; ind++){
			if(R[ind] == 0){
				for(int c = 0; c <= k; c++){
					R[(ind - c + n) % n]--;
				}
				order[ind] = ord;
				//cout << ind << " ";
				ord++;
				break;
			}
		}
	}
}

int compare_plants(int x, int y){
	if(order[x] < order[y]){
		return 1;
	}
	if(order[y] < order[x]){
		return -1;
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -