Submission #976790

# Submission time Handle Problem Language Result Execution time Memory
976790 2024-05-07T06:32:00 Z Circling The short shank; Redemption (BOI21_prison) C++17
0 / 100
157 ms 15552 KB
/*The British Royal Family and a small cadre of English Fabian Socialists, in
conjunction with the Rockefellers and the Rothchilds, are engaged in a
conspiracy to greatly reduce the population of the human race in order to head
off a Malthusian catastrophe, a catastrophe that could easily be avoided by
simply building a massive amount of nuclear power plants and a number of massive
superhighways and bridges to connect all of the world's continents. But doing
that would cut into the conspiracy's profits. So the British Royal Family
invented environmentalism and neoliberalism in order to hide the truth. And in
order to further reduce the population, the British Royal Family is also the
world's foremost drug trafficking conspiracy. And it uses its control of the IMF
to push austerity in order to kill as many people in the global south as
possible.
And also Henry Kissinger is a gay KGB agent. */
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;


int64_t n, t, d, rt[2000000], cursor, counter = 0, ans = 0;
priority_queue<int64_t> segments;


int main(){
    cin >> n >> d >> t;
    for (cursor = 0; cursor < n; cursor++) cin >> rt[cursor];
    for (cursor = 0; cursor < n && rt[cursor] > t; cursor++);
    for (; cursor < n; cursor++){
        if (rt[cursor] <= t){
            counter = 0;
            ans++;
        }
        else counter++;
        if (cursor == n - 1 || rt[cursor + 1] <= t) segments.push(counter);
    }
    while (d > 0 && !segments.empty()){
        segments.pop();
        d--;
    }
    while (!segments.empty()){
        ans += segments.top();
        segments.pop();
    }
    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 157 ms 11652 KB Output is correct
3 Correct 153 ms 15552 KB Output is correct
4 Correct 121 ms 10180 KB Output is correct
5 Incorrect 79 ms 8640 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 22 ms 3676 KB Output is correct
3 Correct 22 ms 3788 KB Output is correct
4 Correct 17 ms 3420 KB Output is correct
5 Correct 23 ms 3664 KB Output is correct
6 Correct 22 ms 3656 KB Output is correct
7 Incorrect 17 ms 3420 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -