제출 #1201745

#제출 시각아이디문제언어결과실행 시간메모리
1201745noop9월 (APIO24_september)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<int> g; vector<bool> s; int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) { g.resize(N,0); s.resize(N,0); int ans=0,t=0,c,p; for (int i=1; i<N; i++){ g[F[i]]++; } for (int i=0; i<S[0].size(); i++){ c=S[0][i]; if (g[c]){ t++; v[c]++; } p=F[c]; g[p]--; if (!g[p] and s[p]){ t--; } if (!t){ ans++; } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

september.cpp: In function 'int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)':
september.cpp:16:7: error: 'v' was not declared in this scope
   16 |       v[c]++;
      |       ^