이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "supertrees.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <utility>
#define V vector
#define P pair
#define S second
#define F first
#define pb push_back
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7
int construct(std::vector<std::vector<int>> p) {
int n =(int) p.size();
V<V<int>>ans(n,V<int>(n,0));
V<int>component(n);
V<bool>visited(n,false);
for(int i=0;i<n;i++){
if(visited[i])continue;
component[i]=i;
for(int j=0;j<n;j++){
if(i==j)continue;
if(p[i][j]) {
if(visited[j])return 0;
visited[j] = true;
component[j] = i;
ans[i][j] = 1;
ans[j][i] = 1;
}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if((component[i]==component[j])!=p[i][j])return 0;
}
}
build(ans);
return 1;
}
컴파일 시 표준 에러 (stderr) 메시지
supertrees.cpp:16:12: warning: 'called' defined but not used [-Wunused-variable]
16 | static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7
| ^~~~~~
# | 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... |