# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
426337 | dolphingarlic | The short shank; Redemption (BOI21_prison) | C++14 | 452 ms | 125052 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int depth[2000001], mx_child[2000001];
vector<int> children[2000001];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, d, tx;
cin >> n >> d >> tx;
int ans = n, glob_mx = 0, loc_mx = 0;
priority_queue<pair<int, int>> pq;
stack<pair<int, int>> stck;
for (int i = 1; i <= n; i++) {
int t;
cin >> t;
glob_mx = max(glob_mx, i + tx - t);
loc_mx = max(loc_mx, i + tx - t);
if (stck.size())
stck.top().second = max(stck.top().second, loc_mx);
if (t > tx) {
if (glob_mx < i) ans--;
else {
depth[i] = 1;
while (stck.size()) {
int node, tmp_mx;
tie(node, tmp_mx) = stck.top();
if (tmp_mx >= i) break;
children[i].push_back(node);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |