제출 #338089

#제출 시각아이디문제언어결과실행 시간메모리
338089sealnot123슈퍼트리 잇기 (IOI20_supertrees)C++14
11 / 100
251 ms24192 KiB
/* Author: AquaBlaze Keqing best girl :) Nephren will always be in my heart */ #include<bits/stdc++.h> #define x first #define y second #define pb push_back #define eb emplace_back #define all(a) (a).begin(),(a).end() #define SZ(a) (int)(a).size() #define FOR(i, a, b) for(int i=(a); i<=(b); ++i) #define ROF(i, a, b) for(int i=(a); i>=(b); --i) #define make_unique(a) sort(all((a))), (a).resize(unique(all((a)))-(a).begin()) #define pc(x) putchar(x) #define MP make_pair #define MT make_tuple using namespace std; typedef long long i64; typedef tuple<int,int,int> iii; typedef pair<int,int> pii; typedef pair<long,long> pll; typedef vector<int> vi; typedef vector<vi> vvi; #include "supertrees.h" //#include "grader.cpp" int construct(vvi p) { int n = p.size(); vvi answer(n, vi(n)); int mx = 1; FOR(i, 0, n-1) FOR(j, 0, n-1) mx = max(mx, p[i][j]); if(mx == 1){ int mark[n] = {}; FOR(i, 0, n-1){ if(mark[i]) continue; mark[i] = 1; FOR(j, 0, n-1){ if(i == j) continue; if(p[i][j] && mark[j]) return 0; if(p[i][j]) answer[i][j] = answer[j][i] = 1, mark[j] = 1; } } build(answer); return 1; } build(answer); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...