제출 #1348998

#제출 시각아이디문제언어결과실행 시간메모리
1348998yyc000123벽 칠하기 (APIO20_paint)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std ;
const int N = 505 ;
const int M = 5e4+5 ;
const int K = 1e5+5 ;
int arr[N][K] , brr[N] ;
set<int> st ;

int minimumInstructions(int n , int m , int k , int c[N] , int a[M] , vector<vector<int>> b){
    for(int i=0 ; i<m ; i++){
        for(int j=0 ; j<a[i] ; j++) arr[i][b[i][j]]=1 ;
    }
    for(int i=0 ; i<=n-m ; i++){
        for(int j=0 ; j<m ; j++){
            bool flag = true ;
            for(int l=0 ; l<m && flag ; l++){
                if(!arr[(j+l)%m][c[i+l]]) flag = false ;
            }
            if(flag){
                st.insert(i) ;
                break ;
            }
        }
    }
    if(st.find(0)==st.end()) return false ;
    int ri = m-1 , cnt = 0 ;
    while(ri<n-1){
        auto it = st.upper_bound(ri) ;
        if(it==st.begin()) return -1 ;
        it-- ; cnt++ ;
        if(*it+m-1<=ri) return -1 ;
        ri = *it + m-1 ;
    }
    return cnt ;
}

/*
int main(){
    // cout << minimumInstructions(8, 3, 5, {3, 3, 1, 3, 4, 4, 2, 2}, {3, 2, 2}, {{0, 1, 2}, {2, 3}, {3, 4}}) << '\n' ;
    // cout << minimumInstructions(5, 4, 4, {1, 0, 1, 2, 2}, {2, 1, 1, 1}, {{0, 1}, {1}, {2}, {3}}) << '\n' ;
    return 0 ;
}
*/

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

/usr/bin/ld: /tmp/cch0NdNC.o: in function `main':
grader.cpp:(.text.startup+0x278): undefined reference to `minimumInstructions(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status