# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
830388 | PoonYaPat | Homework (CEOI22_homework) | C++14 | 243 ms | 201380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
string s;
int n,cnt,com[20000005];
bool is_min[2000005];
vector<int> adj[2000005];
int build(int l, int r) {
int now=++cnt;
if (l!=r) {
adj[now].push_back(build(l+4,com[l+3]-1));
adj[now].push_back(build(com[l+3]+1,r-1));
if (s[l+1]=='i') is_min[now]=true;
}
return now;
}
pii dfs(int x) { //return min,max
if (adj[x].size()==0) return pii(1,n);
pii L=dfs(adj[x][0]), R=dfs(adj[x][1]), res;
if (is_min[x]) {
res.first=min(L.first,R.first);
res.second=L.second+R.second-n-1;
} else {
res.first=L.first+R.first;
res.second=max(L.second,R.second);
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |