Submission #146835

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1468352019-08-26 11:09:50Bodo171Split the Attractions (IOI19_split)C++14
0 / 100
159 ms25460 KiB
#include "split.h"
#include <vector>
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
const int nmax=100005;
pair<int,int> col[5];
vector<int> res;
vector<int> v[nmax],ad[nmax],arb[nmax];
int l[nmax],r[nmax],rep[nmax],w[nmax],pond[nmax],big[nmax],q[nmax],viz[nmax],valid[nmax],tt[nmax];
int nr,x,sum,p,u,i,j,k,nod,A,act,gasit,n,cen;
void dfs(int x)
{
rep[++nr]=x;l[x]=nr;
w[x]=1;
for(int i=0;i<arb[x].size();i++)
if(!w[arb[x][i]])
{
tt[arb[x][i]]=x;
dfs(arb[x][i]);
w[x]+=w[arb[x][i]];
big[x]=max(big[x],w[arb[x][i]]);
}
r[x]=nr;
}
void bfs(int x)
{
q[u=1]=x;sum=pond[x];viz[x]=1;
for(p=1;p<=u;p++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

split.cpp: In function 'void dfs(int)':
split.cpp:17:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<arb[x].size();i++)
                 ~^~~~~~~~~~~~~~
split.cpp: In function 'void bfs(int)':
split.cpp:33:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(i=0;i<ad[x].size();i++)
                 ~^~~~~~~~~~~~~
split.cpp: In function 'void coloreaza(int, int)':
split.cpp:71:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(i=0;i<v[x].size();i++)
                 ~^~~~~~~~~~~~
split.cpp: In function 'std::vector<int> find_split(int, int, int, int, std::vector<int>, std::vector<int>)':
split.cpp:110:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<arb[cen].size();i++)
             ~^~~~~~~~~~~~~~~~
split.cpp:145:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(i=0;i<n;i++)
     ^~~
split.cpp:148:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  return res;
  ^~~~~~
#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...