# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
813430 | kostka | Fountain (eJOI20_fountain) | C++14 | 173 ms | 20072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
struct reservoir
{
int D, C;
int next_larger_reservoir = -1;
};
const int LOG = 17;
int N, Q;
vector<reservoir> reservoirs;
// This function generate edges from each reservoir to the
// next reservoir that is strictly larger in diamater
// below us.
void CalculateEdges()
{
stack<int> S;
for (int i = 0; i < N; i++)
{
// If there is an reservoir on the stack that is smaller than us
// then pop it from the stack and set it edge to the reservoir
// that we are currently considering.
while (!S.empty() and reservoirs[S.top()].D < reservoirs[i].D)
{
int s = S.top();
S.pop();
reservoirs[s].next_larger_reservoir = i;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |