제출 #797610

#제출 시각아이디문제언어결과실행 시간메모리
797610elpro123수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
#include "islands.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> find_journey(int N, int M, int[] U, int[] V){
        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 {};
        }
}

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

islands.cpp:5:46: error: expected ',' or '...' before 'U'
    5 | vector<int> find_journey(int N, int M, int[] U, int[] V){
      |                                              ^
islands.cpp: In function 'std::vector<int> find_journey(int, int, int*)':
islands.cpp:8:17: error: 'U' was not declared in this scope
    8 |             if (U[i] == 0) {
      |                 ^