Submission #1035132

# Submission time Handle Problem Language Result Execution time Memory
1035132 2024-07-26T05:08:48 Z NeroZein Radio Towers (IOI22_towers) C++17
0 / 100
487 ms 1900 KB
#include "towers.h"
#include <bits/stdc++.h>
using namespace std; 

const int LOG = 18; 

int n;
vector<int> h;
vector<int> pref;

void init(int N_, vector<int> H_) {
  n = N_, h = H_;
  pref.resize(n - 1);
  for (int i = 1; i < n - 1; ++i) {
    pref[i] = (h[i - 1] < h[i]) && (h[i] < h[i + 1]);
  }
  for (int i = 1; i < n - 1; ++i) {
    pref[i] += pref[i - 1]; 
  }
}

int max_towers(int l, int r, int d) {
  assert(d == 1); 
  if (l == r) {
    return 1; 
  }
  int ans = max(1, pref[r - 1] - pref[l]);
  return ans;
}
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1900 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 487 ms 1880 KB 1st lines differ - on the 1st token, expected: '11903', found: '5985'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 1112 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1900 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -