Submission #315575

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3155752020-10-23 06:45:47tigichaConnecting Supertrees (IOI20_supertrees)C++14
19 / 100
1088 ms30220 KiB
#include "supertrees.h"
#include<bits/stdc++.h>
using namespace std;
int par[1005], ar[1005], a[1005][1005], ans[1005][1005], fix1[1005], n, fix[1005];
vector<int>vec1[1005], vec[1005], v1;
vector<vector<int> >answer;
int parent(int x){
if(par[x]==x) return x;
return par[x]=parent(par[x]);
}
void dsu(int x, int y){
x=parent(x);
y=parent(y);
if(x==y) return;
if(ar[x]<ar[y]) swap(x, y);
par[y]=x;
ar[x]+=ar[y];
}
void rec(int z){
for(int i=0; i<vec1[z].size(); i++)
for(int j=i+1; j<vec1[z].size(); j++){
int x=vec1[z][i];
int y=vec1[z][j];
if(a[x][y]==1){
vec[x].push_back(y);
vec[y].push_back(x);
}
}
v1.clear();
for(int i=0; i<vec1[z].size(); i++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

supertrees.cpp: In function 'void rec(int)':
supertrees.cpp:20:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for(int i=0; i<vec1[z].size(); i++)
      |               ~^~~~~~~~~~~~~~~
supertrees.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |  for(int j=i+1; j<vec1[z].size(); j++){
      |                 ~^~~~~~~~~~~~~~~
supertrees.cpp:30:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for(int i=0; i<vec1[z].size(); i++){
      |               ~^~~~~~~~~~~~~~~
supertrees.cpp:36:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |   for(int j=0; j<vec[x].size(); i++){
      |                ~^~~~~~~~~~~~~~
supertrees.cpp:43:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |  for(int i=0; i<v1.size(); i++){
      |               ~^~~~~~~~~~
#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...