제출 #1024645

#제출 시각아이디문제언어결과실행 시간메모리
1024645overwatch9Stranded Far From Home (BOI22_island)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const int maxn = 2e5 + 1; vector <int> adj[maxn]; int main() { int n, m; cin >> n >> m; for (int i = 1; i <= n; i++) cin >> S[i]; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; adj[a].push_back(b); adj[b].push_back(a); } for (int i = 1; i <= n; i++) { if (S[i] == S[1]) cout << 1; else cout << 0; } cout << '\n'; }

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

island.cpp: In function 'int main()':
island.cpp:10:16: error: 'S' was not declared in this scope
   10 |         cin >> S[i];
      |                ^
island.cpp:18:13: error: 'S' was not declared in this scope
   18 |         if (S[i] == S[1])
      |             ^