Submission #703039

# Submission time Handle Problem Language Result Execution time Memory
703039 2023-02-25T17:05:47 Z siewjh popa (BOI18_popa) C++17
0 / 100
23 ms 336 KB
#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
int solve(int N, int* Left, int* Right){
    stack<int> s;
    for (int i = 0; i < N; i++){
        Left[i] = -1;
        Right[i] = -1;
    }
    for (int i = 0; i < N; i++){
        while (!s.empty()){
            int x = s.top();
            if (query(x, x, x, i)) {
                Right[x] = i;
                break;
            }
            s.pop();
        }
        Left[i] = (s.empty() ? -1 : s.top());
        s.push(i);
    }
    while (s.size() > 1) s.pop();
    return s.top();
}
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 336 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 288 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 23 ms 288 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -