Submission #70083

# Submission time Handle Problem Language Result Execution time Memory
70083 2018-08-22T10:23:43 Z octopuses popa (BOI18_popa) C++17
0 / 100
15 ms 412 KB
#include <bits/stdc++.h>
#include "popa.h"
#pragma GCC optimize("O3")

using namespace std;

int solve(int n, int* lt, int* rt)
{
  int root = 0;
  lt[0] = -1;
  rt[n - 1] = 1;
  for(int i = 1; i < n; ++ i)
    if(query(i - 1, i, i - 1, i - 1))
    {
      rt[i - 1] = i;
      lt[i] = -1;
    } else
    {
      lt[i] = root;
      rt[i - 1] = -1;
      root = i;
    }
}

Compilation message

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 248 KB not a valid binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 384 KB not a valid binary tree
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 412 KB not a valid binary tree
2 Halted 0 ms 0 KB -