제출 #831567

#제출 시각아이디문제언어결과실행 시간메모리
831567caganyanmazWerewolf (IOI18_werewolf)C++17
0 / 100
125 ms48152 KiB
#include <bits/stdc++.h> #define pb push_back #include "werewolf.h" //#define DEBUGGING #ifdef DEBUGGING #include "../debug.h" #else #define debug(x...) void(42) #endif constexpr static int MXN = 3e5; constexpr static int MXST = MXN<<1; constexpr static int INF = 1e6; using namespace std; bitset<MXN> visited[2]; vector<int> g[MXN]; bool valid(int node, int l, int r, int state) { return (state == 0 && node >= l) || (state == 1 && node <= r); } bool dfs(int node, int t, int l, int r, int state) { visited[state][node] = true; if (!valid(node, l, r, state)) return false; debug(node, t, l, r, state); if (state == 1 && node == t) return true; if (state == 0 && !visited[node][1] && dfs(node, t, l, r, 1)) return true; for (int c : g[node]) if (!visited[state][c] && dfs(c, t, l, r, state)) return true; return false; } vector<int> check_validity(int n, vector<int> x, vector<int> y, vector<int> s, vector<int> e, vector<int> L, vector<int> R) { for (int i = 0; i < x.size(); i++) { g[x[i]].pb(y[i]); g[y[i]].pb(x[i]); } vector<int> res(x.size()); for (int i = 0; i < s.size(); i++) { debug("--------"); visited[0].reset(); visited[1].reset(); res[i] = dfs(s[i], e[i], L[i], R[i], 0); } return res; }

컴파일 시 표준 에러 (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:42:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |  for (int i = 0; i < x.size(); i++)
      |                  ~~^~~~~~~~~~
werewolf.cpp:48:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   48 |  for (int i = 0; i < s.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...