제출 #1195833

#제출 시각아이디문제언어결과실행 시간메모리
1195833clementine늑대인간 (IOI18_werewolf)C++20
컴파일 에러
0 ms0 KiB
#include "werewolf.h" #include<bits/stdc++.h> using namespace std; vector<int> graph[200005]; bool visited[200005]; bool result = false; void humanspan(int u, int l) { visited[u] = true; for(auto v: graph[u]) { if(!visited[v] && v >= l) { humanspan(v, l); } } } void wolfspan(int u, int l, int r) { visited[u] = true; for(auto v: graph[u]) { if(visited[v] && v <=r && v >=l) { result = true; return; } if(!visited[v] && v <=r) { wolfspan(v, l, r); } } } int solve(int n, int s, int e, int l, int r) { result = false; for(int i = 0; i < n; i ++) { visited[i] = false; } humanspan(s, l); wolfspan(e, l, r); return result; } 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); for(int i = 0; i < X.size(); i ++) { graph[X[i]].push_back(Y[i]); graph[Y[i]].push_back(X[i]); } for(int i = 0; i < Q; i ++) { A[i] = solve(n, S[i], E[i], L[i], R[i]); } return A; }

컴파일 시 표준 에러 (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:62:22: error: 'n' was not declared in this scope
   62 |         A[i] = solve(n, S[i], E[i], L[i], R[i]);
      |                      ^