Submission #1081806

# Submission time Handle Problem Language Result Execution time Memory
1081806 2024-08-30T11:23:50 Z jer033 Radio Towers (IOI22_towers) C++17
4 / 100
673 ms 1368 KB
#include "towers.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;

vector<int> H;
int N;
int K;

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

int max_towers(int L, int R, int D) {
    if ((L<K) and (K<R) and ((H[K]-H[L])>=D) and (((H[K]-H[R])>=D)))
        return 2;
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 295 ms 1112 KB Output is correct
2 Correct 673 ms 1368 KB Output is correct
3 Correct 589 ms 1368 KB Output is correct
4 Correct 585 ms 1368 KB Output is correct
5 Correct 614 ms 1368 KB Output is correct
6 Correct 640 ms 1368 KB Output is correct
7 Correct 673 ms 1368 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 420 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 0 ms 420 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 481 ms 1368 KB 1st lines differ - on the 1st token, expected: '11903', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 692 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 0 ms 420 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 Correct 295 ms 1112 KB Output is correct
2 Correct 673 ms 1368 KB Output is correct
3 Correct 589 ms 1368 KB Output is correct
4 Correct 585 ms 1368 KB Output is correct
5 Correct 614 ms 1368 KB Output is correct
6 Correct 640 ms 1368 KB Output is correct
7 Correct 673 ms 1368 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Incorrect 0 ms 420 KB 1st lines differ - on the 1st token, expected: '13', found: '1'
12 Halted 0 ms 0 KB -