Submission #686393

# Submission time Handle Problem Language Result Execution time Memory
686393 2023-01-25T08:49:43 Z pere_gil Radio Towers (IOI22_towers) C++17
0 / 100
658 ms 1464 KB
#include "towers.h"
#include "bits/stdc++.h"
using namespace std;

int n,k;
vector<int> h;

void init(int N, vector<int> H) {
	n=N; h=H;
	for(int i=1;i<n-1;i++)
		if(h[i-1]<h[i] && h[i]>h[i+1]) k=i;
}

int max_towers(int l, int r, int d){
	if(l<k && k<r){
		if(h[l]<=h[k]-d && h[r]<=h[k]-d) return 2;
		else return 0;
	}
	else if(l==r) return 1;
	else return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 473 ms 932 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 658 ms 1464 KB 1st lines differ - on the 1st token, expected: '11903', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 291 ms 552 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 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 473 ms 932 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -