Submission #312926

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3129262020-10-14 17:04:20reymontada61Werewolf (IOI18_werewolf)C++14
100 / 100
2594 ms218144 KiB
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
int n, m;
const int MXN = 400005, MXK = 20;
int par[MXN][2];
int nextnode[2];
vector<int> subs[MXN][2];
int value[MXN][2];
int parent(int w, int n) {
if (par[n][w] == n) return n;
return par[n][w] = parent(w, par[n][w]);
}
void connect(int w, int a, int b, int val) {
a = parent(w, a);
b = parent(w, b);
if (a == b) return;
int c = nextnode[w];
nextnode[w]++;
par[a][w] = c;
par[b][w] = c;
subs[c][w].push_back(a);
subs[c][w].push_back(b);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

werewolf.cpp: In function 'void build(int, int, int)':
werewolf.cpp:86:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |  while (lp < contents[ind * 2].size() && rp < contents[ind * 2 + 1].size()) {
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
werewolf.cpp:86:45: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |  while (lp < contents[ind * 2].size() && rp < contents[ind * 2 + 1].size()) {
      |                                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
werewolf.cpp:96:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   96 |  while (lp < contents[ind * 2].size()) {
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
werewolf.cpp:100:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  100 |  while (rp < contents[ind * 2 + 1].size()) {
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...