답안 #1024645

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1024645 2024-07-16T08:51:52 Z overwatch9 Stranded Far From Home (BOI22_island) C++17
컴파일 오류
0 ms 0 KB
#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';
}

Compilation message

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])
      |             ^