제출 #578620

#제출 시각아이디문제언어결과실행 시간메모리
578620FatihSolakpopa (BOI18_popa)C++17
37 / 100
204 ms300 KiB
#include <bits/stdc++.h>
#include "popa.h"
#define N 1005
using namespace std;
int L[N],R[N];
int f(int l,int r){
    if(l > r)return -1;
    for(int i = l;i<=r;i++){
        if(query(l,r,i,i)){
            L[i] = f(l,i-1);
            R[i] = f(i+1,r);
            return i;
        }
    }
}
int solve(int n, int* Left, int* Right){
    for(int i = 0;i<n;i++){
        L[i] = R[i] = -1;
    }
    int ret = f(0,n-1);
    for(int i = 0;i<n;i++){
        Left[i] = L[i];
        Right[i] = R[i];
    }
    return ret;
}

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

popa.cpp: In function 'int f(int, int)':
popa.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...