Submission #836866

# Submission time Handle Problem Language Result Execution time Memory
836866 2023-08-24T16:28:37 Z Abrar_Al_Samit Radio Towers (IOI22_towers) C++17
0 / 100
433 ms 1440 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;

//subtask 4

const int nax = 100005;
int n;
int pre[nax];
void init(int N, vector<int> H) {
  n = N;

  for(int i=1; i<n-1; ++i) {
    if(H[i]>H[i-1] && H[i]>H[i+1]) pre[i] = 1;
    pre[i] += pre[i-1];
  }
}

int max_towers(int L, int R, int D) {
  if(R==0) return 1;
  return pre[R-1] - pre[L];
}
# Verdict Execution time Memory Grader output
1 Incorrect 251 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: '15'
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: '15'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 433 ms 1440 KB 1st lines differ - on the 1st token, expected: '11903', found: '11902'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 170 ms 464 KB 1st lines differ - on the 1st token, expected: '7197', found: '8003'
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: '15'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 251 ms 932 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -