Submission #578620

# Submission time Handle Problem Language Result Execution time Memory
578620 2022-06-17T11:51:08 Z FatihSolak popa (BOI18_popa) C++17
37 / 100
204 ms 300 KB
#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;
}

Compilation message

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 time Memory Grader output
1 Correct 62 ms 292 KB Output is correct
2 Correct 91 ms 208 KB Output is correct
3 Correct 21 ms 208 KB Output is correct
4 Correct 36 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 300 KB too many queries
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 208 KB too many queries
2 Halted 0 ms 0 KB -