제출 #1353057

#제출 시각아이디문제언어결과실행 시간메모리
1353057lukaye_19Art Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
#include "art.h"
#include <bits/stdc++.h>
using namespace std;

vector<int>valid;

void perm(int N,vector<int>t)
{
    if (valid) return;
    
    for (int i = 0; i < N; i++)
    {
        t.push_back(N);
        
        perm(N - 1,t);
    }
    
    if (N == 0)
    {
        int complaints = publish(t);
        
        if (complaints == 0) valid = t;
    }
}

void solve(int N)
{
    perm(N,{});
    
    answer(valid);
}

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

art.cpp: In function 'void perm(int, std::vector<int>)':
art.cpp:9:9: error: could not convert 'valid' from 'std::vector<int>' to 'bool'
    9 |     if (valid) return;
      |         ^~~~~
      |         |
      |         std::vector<int>