Submission #134436

# Submission time Handle Problem Language Result Execution time Memory
134436 2019-07-22T16:43:39 Z thanos popa (BOI18_popa) C++14
0 / 100
2 ms 296 KB
#include<iostream>
#include<popa.h>
using namespace std;
int myway(int l,int r,int* Left,int* Right){
  if(l>r) return -1;
  if(l==r){
    Left[l]=-1;
    Right[l]=-1;
    return l;
  }
  int g=-1;
  for(int i=l; i<=r; i++){
    if(query(l,i-1,i+1,r)){
      Left[i]=myway(l,i-1,Left,Right);
      Right[i]=myway(i+1,r,Left,Right);
      break;
    }
  }
  return g;
}
int solve(int N,int* Left,int* Right){
  int h;
  for(int i=0; i<N; i++){
    if(query(0,i-1,i+1,N-1)){
      h=i;
      break;
    }
  }
  myway(0,N,Left,Right);
  return h;
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:30:10: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
   return h;
          ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB invalid argument
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 296 KB invalid argument
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB invalid argument
2 Halted 0 ms 0 KB -