Submission #967880

# Submission time Handle Problem Language Result Execution time Memory
967880 2024-04-23T04:14:22 Z 12345678 Radio Towers (IOI22_towers) C++17
0 / 100
10 ms 2884 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;

const int nx=2e3+5;

int n, qs[nx];
vector<int> h;

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

int max_towers(int L, int R, int D) {
    if (L==R) return 1;
    return qs[R-1]-qs[L]+(h[L]<h[L+1])+(h[R]<h[R-1]);
}
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 1964 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 0 ms 344 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 Runtime error 10 ms 2884 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 1036 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 Runtime error 10 ms 1964 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -