Submission #866503

# Submission time Handle Problem Language Result Execution time Memory
866503 2023-10-26T09:21:03 Z vjudge1 Radio Towers (IOI22_towers) C++17
0 / 100
418 ms 1600 KB
#include "towers.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 3;
int p = 0;
int a[MAXN];
int n;
void init(int N, vector<int> H) {
	n = N;
	int mx = 0;
	for (int i = 0; i < N; i++){
		if (H[i] > mx) mx = H[i], p = i;
		a[i] = H[i];
	}
	return;
}

int max_towers(int L, int R, int D) {
	if (p != 0 && p != n-1 && a[p-1] <= a[p]-D && a[p+1] <= a[p]-D){
		if (L <= p-1 && p+1 <= R)
			return 2;
	}
	return 1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 235 ms 1112 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 418 ms 1600 KB 1st lines differ - on the 1st token, expected: '11903', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 157 ms 528 KB 1st lines differ - on the 1st token, expected: '7197', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st lines differ - on the 1st token, expected: '13', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 235 ms 1112 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -