Submission #80183

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
801832018-10-19 12:47:12Bodo171Werewolf (IOI18_werewolf)C++14
100 / 100
1283 ms405488 KiB
#include "werewolf.h"
#include <iostream>
using namespace std;
const int nmax=200005;
int i,j,n,nr,m;
int tt[nmax],rg[nmax],T[nmax];
int finds(int x)
{
while(x!=tt[x])
x=tt[x];
return x;
}
void unite(int A,int B)
{
if(rg[A]<rg[B]) swap(A,B);
tt[B]=A;rg[A]+=rg[B];
}
vector<int> v[nmax];
struct arbore
{
int t[20][nmax],l[nmax],r[nmax],rep[nmax];
vector<int> ad[nmax];
void dfs(int x)
{
++nr;l[x]=nr;rep[nr]=x;
for(int i=0;i<ad[x].size();i++)
dfs(ad[x][i]);
r[x]=nr;
}
void solve()
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

werewolf.cpp: In member function 'void arbore::dfs(int)':
werewolf.cpp:26:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int i=0;i<ad[x].size();i++)
                  ~^~~~~~~~~~~~~
werewolf.cpp: In function 'void sweep()':
werewolf.cpp:85:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(j=0;j<qr[i].size();j++)
                 ~^~~~~~~~~~~~~
werewolf.cpp: In function 'std::vector<int> check_validity(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
werewolf.cpp:105:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(j=0;j<v[i].size();j++)
               ~^~~~~~~~~~~~
werewolf.cpp:117:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(j=0;j<v[i].size();j++)
               ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...