Submission #1016350

# Submission time Handle Problem Language Result Execution time Memory
1016350 2024-07-07T21:30:04 Z Unforgettablepl Comparing Plants (IOI20_plants) C++17
0 / 100
1 ms 604 KB
#include <bits/stdc++.h>
using namespace std;

vector<int> h;

void init(int k, std::vector<int> r) {
	int n = r.size();
	h.resize(n);
	vector<bool> taken(n);
	for(int ht=n;ht;ht--){
		for(int i=0;i<n;i++){
			if(r[i]!=0)continue;
			bool works = true;
			int j=i;
			for(int len=1;len<k;len++){
				j=(j-1+n)%n;
				if(r[j]==0)works=false;
			}
			if(works){
				h[i]=ht;
				break;
			} else {
				i+=k-1;
			}
		}
	}
}

int compare_plants(int x, int y) {
	if(h[x]>h[y])return 1;
	else return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 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 348 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 Incorrect 1 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 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 348 KB Output is correct
3 Incorrect 0 ms 344 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 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -