Submission #1081804

# Submission time Handle Problem Language Result Execution time Memory
1081804 2024-08-30T11:22:24 Z wood Comparing Plants (IOI20_plants) C++17
0 / 100
1 ms 592 KB
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>

vi pref;

void init(int k, std::vector<int> r) {
	int n = r.size();
	pref.resize(n+1);
	for(int i = 0; i<n; i++)
		pref[i+1] = pref[i]+r[i];
}

int compare_plants(int x, int y) {
	int p = 1;
	if(x>y) {
		p = -1;
		swap(x,y);
	}
	if(pref[y]-pref[x]==y-x) return p;
	if(pref[y]-pref[x]==0) return -p;
	else return 0;
	return 0;
}
# 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 0 ms 592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -