#include <bits/stdc++.h>
#include "popa.h"
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 110;
/*int query(int a, int b, int c, int d) {
cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
int answer;
cin>>answer;
return answer;
}*/
int parent[maxn];
int li[maxn], ri[maxn];
int solvef(int l, int r) {
if(l == r) return l;
if(l == r-1) {
ri[l] = r;
return l;
}
for(int i=l+1;i<=r-1;i++) {
if(query(l, i, i, r)) {
// valid cut point
li[i] = solvef(l, i-1);
ri[i] = solvef(i+1, r);
return i;
}
}
}
// solve function
int solve(int n, int *l , int *r) {
for(int i=0;i<n;i++) {
li[i] = ri[i] = -1;
parent[i] = i;
}
int x = solvef(0, n-1);
return x;
}
/*int main() {
int a[6], b[6];
cout<<solve(6, a, b);
return 0;
}*/
Compilation message
popa.cpp: In function 'int solvef(int, int)':
popa.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
49 ms |
420 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
24 ms |
432 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |