# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971500 | gutzzy | Political Development (BOI17_politicaldevelopment) | C++14 | 3088 ms | 340344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int unsigned short
int32_t main(){
int n, k, d, a;
cin >> n >> k;
vector<vector<bool>> ady(n,vector<bool>(n,0));
set<set<int>> last;
for(int i=0;i<n;i++){
last.insert({i});
cin >> d;
for(int j=0;j<d;j++){
cin >> a;
ady[min(i,a)][max(i,a)] = 1;
}
}
int cur = 2;
bool optim = false;
while(cur<=k){
int s = last.size();
set<set<int>> nw;
for(auto li:last){
if(optim) break;
// last[i] --> completed graphs of cur-1 nodes
for(int x=0;x<n;x++){
if (optim) break;
bool found = true;
for(auto p:li){
if(ady[min(x,p)][max(x,p)]==0){
Compilation message (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... |