Submission #830670

# Submission time Handle Problem Language Result Execution time Memory
830670 2023-08-19T09:06:43 Z NeroZein Radio Towers (IOI22_towers) C++17
0 / 100
366 ms 1328 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 : 1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 360 ms 976 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: '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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 366 ms 1328 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 167 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: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 360 ms 976 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -