Submission #424441

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4244412021-06-12 00:21:37MrFranchoConnecting Supertrees (IOI20_supertrees)C++14
Compilation error
0 ms0 KiB
#include "supertrees.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
vector<vector<int>> connectedGroups;
vector<bool> vis(MAXN);
int n;
void DFS(int node, int cur, vector<vector<int>> &p) {
connectedGroups[cur].push_back(node);
vis[node] = true;
for(int i = 0; i < n; i++) {
if(p[node][i] == 1 && !vis[i])
DFS(i,cur,p)
}
}
int construct(vector<vector<int>> p) {
n = p.size();
vector<vector<int>> answer;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
answer[i][j] = 0;
for(int k = 0; k < n; k++) {
if(p[i][k] == 1 && p[j][k] == 1 && p[i][j] != 1)
return 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

supertrees.cpp: In function 'void DFS(int, int, std::vector<std::vector<int> >&)':
supertrees.cpp:17:16: error: expected ';' before '}' token
   17 |    DFS(i,cur,p)
      |                ^
      |                ;
   18 |  }
      |  ~              
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:44:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |   for(int i = 1; i < v.size(); i++) {
      |                  ~~^~~~~~~~~~