Submission #830668

# Submission time Handle Problem Language Result Execution time Memory
830668 2023-08-19T09:06:09 Z NeroZein Radio Towers (IOI22_towers) C++17
0 / 100
373 ms 1436 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;

int id;
int mx, mx2;
vector<int> a; 
void init(int N, std::vector<int> H) {
  id = N - 1;
  a = H; 
  for (int i = 0; i < N - 1; ++i) {
    if (H[i] > H[i + 1]) id = i;
  }
  for (int i = 0; i < id; ++i) {
    mx = min(mx, H[i]); 
  }
  for (int i = id + 1; i < N; ++i) {
    mx2 = min(mx, H[i]); 
  }
}

int max_towers(int L, int R, int D) {
  return (L < id && R > id && max(a[id] - mx, a[id] - mx2) >= D ? 2 : 0);
}
# Verdict Execution time Memory Grader output
1 Incorrect 283 ms 924 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: '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 373 ms 1436 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 191 ms 556 KB 1st lines differ - on the 1st token, expected: '7197', found: '2'
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 283 ms 924 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -