# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
43677 | baactree | 열대 식물원 (Tropical Garden) (IOI11_garden) | C++14 | 305 ms | 55616 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "garden.h"
#include "gardenlib.h"
#include <bits/stdc++.h>
using namespace std;
int n, m, p;
vector<int> adj[150005];
vector<int> sadj[300005];
int v[300005], s[300005], cnt[300005];
int vn, sn;
stack<int> st;
int dfs(int now) {
int ret = v[now] = vn++;
st.push(now);
for (auto &there : sadj[now]) {
if (v[there] == -1)
ret = min(ret, dfs(there));
else if (s[there] == -1)
ret = min(ret, v[there]);
}
if (ret == v[now]) {
while (true) {
int temp = st.top();
st.pop();
s[temp] = sn;
cnt[sn]++;
if (temp == now)break;
}
sn++;
}
return ret;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |