제출 #1276803

#제출 시각아이디문제언어결과실행 시간메모리
1276803sepantaNewspapers (CEOI21_newspapers)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector<vector<int>> adj(N + 1); for (int i = 0; i < M; i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } vector<int> color(N + 1, -1); bool bipartite = true; vector<int> partA, partB; queue<int> q; color[1] = 0; q.push(1); while (!q.empty() && bipartite) { int u = q.front(); q.pop(); for (int v : adj[u]) { if (color[v] == -1) { color[v] = 1 - color[u]; q.push(v); } else if (color[v] == color[u]) { bipa

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

newspapers.cpp: In function 'int main()':
newspapers.cpp:34:17: error: 'bipa' was not declared in this scope
   34 |                 bipa
      |                 ^~~~
newspapers.cpp:34:21: error: expected '}' at end of input
   34 |                 bipa
      |                     ^
newspapers.cpp:33:46: note: to match this '{'
   33 |             } else if (color[v] == color[u]) {
      |                                              ^
newspapers.cpp:34:21: error: expected '}' at end of input
   34 |                 bipa
      |                     ^
newspapers.cpp:29:30: note: to match this '{'
   29 |         for (int v : adj[u]) {
      |                              ^
newspapers.cpp:34:21: error: expected '}' at end of input
   34 |                 bipa
      |                     ^
newspapers.cpp:27:37: note: to match this '{'
   27 |     while (!q.empty() && bipartite) {
      |                                     ^
newspapers.cpp:34:21: error: expected '}' at end of input
   34 |                 bipa
      |                     ^
newspapers.cpp:4:12: note: to match this '{'
    4 | int main() {
      |            ^