Submission #1035270

# Submission time Handle Problem Language Result Execution time Memory
1035270 2024-07-26T08:29:53 Z NeroZein Radio Towers (IOI22_towers) C++17
0 / 100
4000 ms 1368 KB
#include "towers.h"
#include <bits/stdc++.h>
using namespace std; 
 
int n;
vector<int> h;
void init(int N_, vector<int> H_) {
  n = N_, h = H_;
}
 
int max_towers(int l, int r, int d) {
  int lst = l - 1;
  int good_towers = 0; 
  for (int i = l + 1; i < r; ++i) {
    if (h[i] < h[i - 1] || h[i] < h[i + 1]) {
      continue; 
    }
    int mn = h[lst + 1];
    for (int j = lst + 1; j < i; ++j) {
      mn = min(mn, h[j]); 
    }
    if (h[i] - mn >= d) {
      lst = i;
      good_towers++;
    }
  }
  return good_towers + 1; 
}
# Verdict Execution time Memory Grader output
1 Incorrect 1152 ms 1112 KB 5th lines differ - on the 1st token, expected: '1', 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: '15'
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: '15'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4043 ms 1368 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4024 ms 600 KB Time limit exceeded
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: '15'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1152 ms 1112 KB 5th lines differ - on the 1st token, expected: '1', found: '2'
2 Halted 0 ms 0 KB -