Submission #827933

# Submission time Handle Problem Language Result Execution time Memory
827933 2023-08-16T23:09:41 Z Seb Radio Towers (IOI22_towers) C++17
0 / 100
342 ms 1828 KB
#include "towers.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define f first
#define s second

ll k,h[100005];

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

int max_towers(int L, int R, int D) {
if (L > k || k > R) return 0;
if (h[L] <= h[k]-D && h[R] <= h[k]-D) return 2;
}

Compilation message

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 327 ms 1228 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 342 ms 1828 KB 1st lines differ - on the 1st token, expected: '11903', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 114 ms 560 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 1 ms 208 KB 1st lines differ - on the 1st token, expected: '13', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 327 ms 1228 KB 1st lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -