Submission #735617

# Submission time Handle Problem Language Result Execution time Memory
735617 2023-05-04T12:00:38 Z math_rabbit_1028 Radio Towers (IOI22_towers) C++17
0 / 100
545 ms 1944 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 max(cnt[R - 1] - cnt[L], 0) + 1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 458 ms 1072 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 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 545 ms 1944 KB 1st lines differ - on the 1st token, expected: '11903', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 223 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 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 458 ms 1072 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -