Submission #239183

# Submission time Handle Problem Language Result Execution time Memory
239183 2020-06-14T17:30:14 Z lakshith_ Detecting Molecules (IOI16_molecules) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
int find_subset(int l, int u, int[] w, int n, int[] result){
  int m = 0;
  int lo,hi;
  lo = ceil((double)l/(double)w[0]);
  hi = floor((double)u/(doublew[0]));
  if(n<lo||(lo>=hi))return 0;
  for(int i=0;i<lo;i++)
    result[m++] = w[0];
  return m;
}

Compilation message

molecules.cpp:4:37: error: expected ',' or '...' before 'w'
 int find_subset(int l, int u, int[] w, int n, int[] result){
                                     ^
molecules.cpp: In function 'int find_subset(int, int, int*)':
molecules.cpp:7:31: error: 'w' was not declared in this scope
   lo = ceil((double)l/(double)w[0]);
                               ^
molecules.cpp:8:25: error: 'doublew' was not declared in this scope
   hi = floor((double)u/(doublew[0]));
                         ^~~~~~~
molecules.cpp:8:25: note: suggested alternative: 'double'
   hi = floor((double)u/(doublew[0]));
                         ^~~~~~~
                         double
molecules.cpp:9:6: error: 'n' was not declared in this scope
   if(n<lo||(lo>=hi))return 0;
      ^
molecules.cpp:11:5: error: 'result' was not declared in this scope
     result[m++] = w[0];
     ^~~~~~