Submission #146814

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1468142019-08-26 09:27:49Bodo171Split the Attractions (IOI19_split)C++14
0 / 100
110 ms15840 KiB
#include "split.h"
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const int nmax=100005;
pair<int,int> col[5];
vector<int> res;
vector<int> v[nmax],ad[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<v[x].size();i++)
if(!w[v[x][i]])
{
dfs(v[x][i]);
w[x]+=w[v[x][i]];
big[x]=max(big[x],w[v[x][i]]);
}
r[x]=nr;
}
void bfs(int x)
{
q[u=1]=x;sum=pond[x];
for(p=1;p<=u;p++)
{
x=q[p];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

split.cpp: In function 'void dfs(int)':
split.cpp:16:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<v[x].size();i++)
                 ~^~~~~~~~~~~~
split.cpp: In function 'void bfs(int)':
split.cpp:31: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:68: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:99:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<v[cen].size();i++)
             ~^~~~~~~~~~~~~~
split.cpp:123:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int it=0;it<v[cen].size();it++)
                  ~~^~~~~~~~~~~~~~
split.cpp:133:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(i=0;i<n;i++)
     ^~~
split.cpp:136: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...