| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 980919 | vjudge1 | Beech Tree (IOI23_beechtree) | C++17 | 2094 ms | 16332 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "beechtree.h"
using namespace std;
#define pb push_back
#include<bits/stdc++.h>
#define deb(x) cout<<#x<<": "<<x<<endl;
bool DFS (int N, vector<vector<int>> &sons,vector<int> &P, vector<int> &C){
    if(sons[N].size()==0) return true;
    vector<int> st;
    st.pb(N);
    queue<int> q;
    for(int x: sons[N]){
        q.push(x);
    }
    while(!q.empty()){
        int x=q.front();
        q.pop();
        st.pb(x);
        for(int a:sons[x]){
            q.push(a);
        }
    }
    sort(st.begin(), st.end());
    do{
   
        vector<int> colors;
        //colors.pb(C[st[0]]);
        bool works=true;
        for(int i=1; i<st.size(); ++i){ 
            int cont=0;
            for(int x: colors){
                if(x==C[st[i]]){
                    cont++;
                }
            }
            if(st[cont]!=P[st[i]]){
                works=false;
                break;
            }
            colors.pb(C[st[i]]);
        }
        if(works){
            return true;
        }
    }while(next_permutation(st.begin()+1, st.end()));
    return false;
}
vector<int> beechtree(int N, int M, vector<int> P, vector<int> C)
{
    vector<int> ans (N,0);
    vector<vector<int>> sons (N);
    for(int i=1;i<N; ++i){
        sons[P[i]].pb(i);
    }
    for(int i=0; i<N; ++i){
        if(DFS(i, sons, P, C)){
            ans[i]=1;
        }
    }
    return ans;
    return {};
}
컴파일 시 표준 에러 (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... | ||||
| # | 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... | ||||
