Submission #474715

#TimeUsernameProblemLanguageResultExecution timeMemory
474715AnasBenMoussaDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> typedef double db ; using namespace std; #define all(x) begin(x), end(x) #define pb push_back #define int long long #define doub(k) printf("%.1lf\n", k) // setprecision(5) typedef pair<int ,int > pll;typedef map<int , int > mll;typedef vector<int > vll;typedef vector<pll>vpll; typedef set<int > sll; const int nx[4] = {0, 0, 1, -1}, ny[4] = {1, -1, 0, 0}; const int dr[8] = {1,1,0,-1,-1,-1, 0, 1}, dc[8] = {0,1,1, 1, 0,-1,-1,-1}; int find_subset(int l, int u, int[] w, int n, int[] result) { int df=u-l; if(df/w[0]>n){ return 0; } else{ for(int i=0;i<df/w[0];i++){ result[i]=w[0]; } } return result; }

Compilation message (stderr)

molecules.cpp:13:37: error: expected ',' or '...' before 'w'
   13 | int find_subset(int l, int u, int[] w, int n, int[] result) {
      |                                     ^
molecules.cpp: In function 'long long int find_subset(long long int, long long int, long long int*)':
molecules.cpp:16:11: error: 'w' was not declared in this scope
   16 |     if(df/w[0]>n){
      |           ^
molecules.cpp:16:16: error: 'n' was not declared in this scope
   16 |     if(df/w[0]>n){
      |                ^
molecules.cpp:22:13: error: 'result' was not declared in this scope
   22 |             result[i]=w[0];
      |             ^~~~~~
molecules.cpp:25:12: error: 'result' was not declared in this scope
   25 |     return result;
      |            ^~~~~~