제출 #654834

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

variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V)
{
    vector<int> c1, c2;
    for(int i = 0; i < M; i++)
    {
        if(U[i] == 0)
        {
            c1.push_back(i);
        }
        else
        {
            c2.push_back(i);
        }
    }
    if(c1.size() < 2 || c2.size() < 1)
    {
        return false;
    }
    return vector<int>({c1[0], c2[0], c1[1], c1[0], c2[0], c1[1]});
    // if true
    return vector<int>({0, 1, 2});
    // if false
    return false;
}

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

islands.cpp:5:56: error: 'vect' has not been declared
    5 | variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V)
      |                                                        ^~~~
islands.cpp:5:61: error: expected ',' or '...' before 'or' token
    5 | variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V)
      |                                                             ^~
islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, int)':
islands.cpp:10:12: error: 'U' was not declared in this scope
   10 |         if(U[i] == 0)
      |            ^