Submission #797592

#TimeUsernameProblemLanguageResultExecution timeMemory
797592elpro123수천개의 섬 (IOI22_islands)C++17
Compilation error
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;
        }
    }
}

Compilation message (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) {
      |      ~^~~~
      |       )