Submission #239183

#TimeUsernameProblemLanguageResultExecution timeMemory
239183lakshith_Detecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

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];
     ^~~~~~