Submission #651012

# Submission time Handle Problem Language Result Execution time Memory
651012 2022-10-16T12:40:27 Z NaimSS Radio Towers (IOI22_towers) C++17
0 / 100
675 ms 1744 KB
#include "towers.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
#include <vector>

const int N = 100100;
int cnt[N];
int h[N];
vector<int> pos;
#define pico ahiusuhashuis
vector<int> pico;
void init(int N, std::vector<int> H) {
  for(int i=0;i<N;i++)h[i] = H[i];
 
  for(int i=0;i<N;i++){
    int l = (i == 0 || H[i] < H[i-1]);
    int r = (i == N-1 || H[i] < H[i+1]);
    if(l && r){
      cnt[i]++;
    }
    if(i)cnt[i]+=cnt[i-1];
  }
}

int max_towers(int L, int R, int D) {
  if(L==R)return 1;
  return max(1,cnt[R]-(L>0?cnt[L-1]:0));
}
# Verdict Execution time Memory Grader output
1 Incorrect 405 ms 1200 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 256 KB 1st lines differ - on the 1st token, expected: '13', found: '16'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 1st lines differ - on the 1st token, expected: '13', found: '16'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 675 ms 1744 KB 1st lines differ - on the 1st token, expected: '11903', found: '11902'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 236 ms 592 KB 1st lines differ - on the 1st token, expected: '7197', found: '8004'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 1st lines differ - on the 1st token, expected: '13', found: '16'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 405 ms 1200 KB 12th lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -