| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 469815 | AdamGS | 슈퍼트리 잇기 (IOI20_supertrees) | C++14 | 259 ms | 28012 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "supertrees.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
int construct(vector<vector<int>>p) {
int n=p[0].size();
vector<pair<vector<int>,int>>V;
rep(i, n) {
vector<int>a;
rep(j, n) if(p[i][j]) a.pb(1); else a.pb(0);
V.pb({a, i});
}
sort(all(V));
vector<vector<int>>spojne;
vector<int>akt1=V[0].st, akt2;
akt2.pb(V[0].nd);
for(int i=1; i<V.size(); ++i) {
if(V[i].st!=akt1) {
vector<int>jakie;
rep(j, n) if(akt1[j]) jakie.pb(j);
if(jakie!=akt2) return 0;
spojne.pb(akt2);
akt1=V[i].st;
akt2.clear();
}
akt2.pb(V[i].nd);
}
vector<int>jakie;
rep(j, n) if(akt1[j]) jakie.pb(j);
if(jakie!=akt2) return 0;
spojne.pb(akt2);
vector<vector<int>>ans;
rep(i, n) {
vector<int>a;
rep(j, n) a.pb(0);
ans.pb(a);
}
for(auto i : spojne) {
rep(j, i.size()-1) {
ans[i[j]][i[j+1]]=ans[i[j+1]][i[j]]=1;
}
}
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... | ||||
