Submission #824235

# Submission time Handle Problem Language Result Execution time Memory
824235 2023-08-13T19:41:59 Z Liudas Radio Towers (IOI22_towers) C++17
0 / 100
4000 ms 1360 KB
#include "towers.h"

#include <cassert>
#include <cstdio>

#include <bits/stdc++.h>
using namespace std;
vector<int> h;
void init(int N, vector<int> H){
    h = H;
}
int max_towers(int L, int R, int D){
    int score = 0;
    for(int i = 0; i < *max_element(h.begin(), h.end()); i ++){
        int H = i;
        int s = 0;
        bool good = false;
        for(int j = L; j <= R; j ++){
            if(!good && h[j] <= H){
                s ++;
                good = true;
            }
            else if(good && h[j] >= H + D){
                good = false;
            }
        }
        score = max(score, s);
    }
    return score;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 4072 ms 924 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4070 ms 208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4070 ms 208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4032 ms 1360 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4072 ms 464 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4070 ms 208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4072 ms 924 KB Time limit exceeded
2 Halted 0 ms 0 KB -