Submission #600590

#TimeUsernameProblemLanguageResultExecution timeMemory
600590jack715Werewolf (IOI18_werewolf)C++14
0 / 100
4098 ms22404 KiB
#include "werewolf.h" #include <bits/stdc++.h> #define ll long long #define pb push_back #define pp pop_back #define mp make_pair #define bb back #define ff first #define ss second using namespace std; vector<int> check_validity(int n, vector<int> x, vector<int> y, vector<int> s, vector<int> e, vector<int> l, vector<int> r) { int Q = s.size(); vector<int> A(Q); vector<int> path[n]; for (int i = 0; i < x.size(); i++) { path[x[i]].pb(y[i]); path[y[i]].pb(x[i]); } queue<int> bfs; for (int i = 0; i < Q; i++) { vector<int> used(n, 0); bfs.push(s[i]); while (!bfs.empty()) { int now = bfs.front(); bfs.pop(); for (int next : path[now]) { if (used[next] || next < l[i]) continue; used[next] = 1; bfs.push(next); } } for (int j = l[i]; j <= r[i]; j++) { if (used[j]) bfs.push(j); } // cout << "WAY\n"; while (!bfs.empty()) { int now = bfs.front(); bfs.pop(); for (int next : path[now]) { if (used[next] || next > r[i]) continue; used[next] = 1; bfs.push(next); } } // cout << "WUT\n"; if (used[e[i]]) A[i] = 1; } return A; } /* 6 6 3 5 1 1 2 1 3 3 4 3 0 5 2 4 2 1 2 4 2 2 2 5 4 3 4 */

Compilation message (stderr)

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:19:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   for (int i = 0; i < x.size(); i++) {
      |                   ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...