# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
613044 | penguinhacker | HicCup (FXCUP4_hiccup) | C++17 | 69 ms | 34812 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "hiccup.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN=1e6+2;
int n=1, cnt[mxN];
stack<int> stk;
vector<int> adj[mxN];
bool dfs(int u, int x) {
for (int v : adj[u])
if (!dfs(v, x))
return 0;
reverse(adj[u].begin(), adj[u].end());
int cur=0;
for (int i=0; i<adj[u].size(); ++i) {
cur+=cnt[adj[u][i]]-x;
if (cur<0)
return 0;
}
reverse(adj[u].begin(), adj[u].end());
return 1;
}
int HicCup(string s) {
stk.push(0);
for (int i=0; i<s.size(); ++i) {
if (s[i]=='H') {
adj[stk.top()].push_back(n);
stk.push(n++);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |