Submission #249606

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2496062020-07-15 10:40:04huuducproWerewolf (IOI18_werewolf)C++14
100 / 100
775 ms98276 KiB
#include <bits/stdc++.h>
#include "werewolf.h"
using namespace std;
const int N=200002;
typedef vector <int> vi;
typedef pair <int,int> pp;
int m,q,n;
vector <pp> pl[N],pr[N];
vector <int> A[N],vl[N],vr[N];
int dsu[N],gl[N],gr[N],fl[N],fr[N],x[N],y[N],rx[N],ry[N];
int type,dem;
int bit[N];
vector <int> res;
int root(int u)
{
while (dsu[u]>0) u=dsu[u];
return u;
}
void unionn(int u,int v)
{
if (dsu[u]>dsu[v]) swap(u,v);
dsu[u]+=dsu[v];dsu[v]=u;
if (type==0) vl[u].push_back(v);
else vr[u].push_back(v);
// cout<<type<<' '<<u<<' '<<v<<endl;
}
void dfsl(int u)
{
x[u]=++dem;
for (int v:vl[u])
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

werewolf.cpp: In function 'void build()':
werewolf.cpp:61:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<pl[i].size();j++)
                      ~^~~~~~~~~~~~~
werewolf.cpp:83:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<pr[i].size();j++)
                      ~^~~~~~~~~~~~~
werewolf.cpp: In function 'void update(int, int)':
werewolf.cpp:97:11: warning: statement has no effect [-Wunused-value]
     for (i;i<=n;i+=i&(-i))
           ^
werewolf.cpp: In function 'int get(int)':
werewolf.cpp:103:11: warning: statement has no effect [-Wunused-value]
     for (i;i>=1;i-=i&(-i))
           ^
werewolf.cpp: In function 'void solve_rec()':
werewolf.cpp:132:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<Pl[i].size();j++)
                      ~^~~~~~~~~~~~~
werewolf.cpp:138:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<Pr[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...