Submission #735615

# Submission time Handle Problem Language Result Execution time Memory
735615 2023-05-04T11:59:56 Z math_rabbit_1028 Radio Towers (IOI22_towers) C++17
0 / 100
535 ms 1956 KB
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;

int n;
vector<int> arr;
int cnt[101010];

void init(int N, vector<int> H) {
  n = N;
  for (int i = 0; i < N; i++) arr.push_back(H[i]);
  cnt[0] = 0;
  for (int i = 1; i < N; i++) {
    if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1]) cnt[i] = cnt[i - 1] + 1;
  }
}


int max_towers(int L, int R, int D) {
  return cnt[R - 1] - cnt[L] + 1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 483 ms 1104 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 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 535 ms 1956 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 296 ms 720 KB 1st lines differ - on the 1st token, expected: '7197', found: '1'
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 483 ms 1104 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -