이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "supertrees.h"
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define lb lower_bound
using namespace std;
const int MAXN = 1e3+10;
const double SMALL = 1e-6;
typedef pair<int,int> pii;
typedef pair<pii,int> ipii;
int n;
bool done[MAXN];
int use[MAXN];
vector <vector<int>> adj;
void bd(int x, int y){
adj[x][y] = 1; adj[y][x] = 1;
}
int construct(vector<vector<int>> p) {
n = p.size();
vector <int> te(n);
for(int i=0; i<n; i++) adj.pb(te);
for(int i = 0; i < n; i++) {
for(int j=i+1; j < n; j++){
vector <int> vec; vec.pb(i);
if(p[i][j] == 1) vec.pb(j);
for(auto x : vec){
for(auto y : vec){
if(x==y) continue;
if(p[x][y] != 1) return 0;
bd(x, y);
}
}
}
}
for(int i=0; i<n; i++) adj[i][i] = 0;
build(adj);
return 1;
}
# | 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... |