제출 #797592

#제출 시각아이디문제언어결과실행 시간메모리
797592elpro123수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; union(bool, vector<int>) find_journey(int N, int M, vector<int> U, vector<int> V) { if (N == 2) { vector<int> a, b; for (int i = 0; i < M; i++) { if (U[i] == 0) { a.push_back(i); } else { b.push_back(i); } } if (a.size() >= 2 && b.size() >= 1) { return vector{a[0], b[0], a[1], a[0], b[0], a[1]}; } else { return false; } } }

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

islands.cpp:4:6: error: expected identifier before '(' token
    4 | union(bool, vector<int>) find_journey(int N, int M, vector<int> U, vector<int> V) {
      |      ^
islands.cpp:4:7: error: expected unqualified-id before 'bool'
    4 | union(bool, vector<int>) find_journey(int N, int M, vector<int> U, vector<int> V) {
      |       ^~~~
islands.cpp:4:7: error: expected ')' before 'bool'
    4 | union(bool, vector<int>) find_journey(int N, int M, vector<int> U, vector<int> V) {
      |      ~^~~~
      |       )