Submission #1032441

# Submission time Handle Problem Language Result Execution time Memory
1032441 2024-07-23T18:59:43 Z Mr_Husanboy Radio Towers (IOI22_towers) C++17
0 / 100
450 ms 1368 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;


#define ff first
#define ss second
#define all(a) (a).begin(), (a).end()
#define ll long long

template<typename T>
int len(T &a){
    return a.size();
}

int n;
vector<int> h;

int mx = 0;



void init(int N, std::vector<int> H) {
  n = N;
  h = H;
  for(int i = 0; i < n; i ++){
    if(h[mx] < h[i]){
      mx = i;
    }
  }
}

int max_towers(int l, int r, int d) {
  if(r <= mx || l >= mx){
    return 1;
  }
  return (min(h[r] - h[mx], h[mx] - h[l]) >= d ? 2 : 1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 232 ms 932 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 344 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 344 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 450 ms 1368 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 143 ms 688 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 344 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 232 ms 932 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -