| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1014559 | Unforgettablepl | 슈퍼트리 잇기 (IOI20_supertrees) | C++17 | 145 ms | 24200 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void build(std::vector<std::vector<int>> b);
int construct(std::vector<std::vector<int>> p) {
    int n = p.size();
    vector<vector<vector<int>>> components;
    for(int i=0;i<n;i++){
        int mycomponent = -1;
        for(int compo=0;compo<components.size();compo++){
            int shouldbe = p[i][components[compo][0][0]];
            shouldbe = min(shouldbe,1);
            if(shouldbe==1){
                if(mycomponent==-1)mycomponent=compo;
                else return 0;
            }
            for(auto&j:components[compo]){
                for(int&k:j){
                    if(shouldbe==0 and p[i][k]!=0)return 0;
                    if(shouldbe==1 and p[i][k]==0)return 0;
                }
            }
        }
        if(mycomponent==-1){
            components.push_back({{i}});
            continue;
        }
        int mychain = -1;
        for(int cha=0;cha<components[mycomponent].size();cha++){
            int shouldbe = p[i][components[mycomponent][cha][0]];
            if(shouldbe==1){
                if(mychain==-1)mychain=cha;
                else return 0;
            }
            for(int&j:components[mycomponent][cha]){
                if(shouldbe!=p[i][j])return 0;
            }
        }
        if(mychain==-1)components[mycomponent].push_back({i});
        else components[mycomponent][mychain].push_back(i);
    }
    vector<vector<int>> ans(n,vector<int>(n));
    for(auto&i:components){
        vector<int> heads;
        for(auto&j:i){
            heads.emplace_back(j[0]);
            for(int k=1;k<j.size();k++){
                ans[j[k-1]][j[k]]=ans[j[k]][j[k-1]]=true;
            }
        }
        if(heads.size()==2)return 0;
        if(heads.size()==1)continue;
        heads.emplace_back(heads.front());
        for(int j=1;j<heads.size();j++){
            ans[heads[j-1]][heads[j]]=ans[heads[j]][heads[j-1]]=true;
        }
    }
    build(ans);
    return 1;
}
컴파일 시 표준 에러 (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... | ||||
