Submission #1055393

#TimeUsernameProblemLanguageResultExecution timeMemory
1055393ArthuroWichWerewolf (IOI18_werewolf)C++17
0 / 100
4054 ms30728 KiB
#include "werewolf.h" #include<bits/stdc++.h> 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<vector<int>> adj(n); for (int i = 0; i < X.size(); i++) { adj[X[i]].push_back(Y[i]); adj[Y[i]].push_back(X[i]); } for (int i = 0; i < q; i++) { int l = L[i], r = R[i]; vector<int> vis(n, 0); queue<int> q; if (S[i] >= l) { q.push(S[i]); } while(!q.empty()) { int a = q.front(); q.pop(); if (vis[a]) { continue; } vis[a] = 1; for (int b : adj[a]) { if (b >= l) { q.push(b); } } } for (int i = l; i <= r; i++) { if (vis[i]) { for (int b : adj[i]) { if (b < l) { q.push(b); } } } } while(!q.empty()) { int a = q.front(); q.pop(); if (vis[a]) { continue; } vis[a] = 1; for (int b : adj[a]) { if (b < r) { q.push(b); } } } a[i] = vis[E[i]]; } return a; }

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:8:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     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...