Submission #448435

#TimeUsernameProblemLanguageResultExecution timeMemory
448435_DaNeK_Detecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
int find_subset(int l, int u, int w[], int n, int result[]) { int s = l; ll cursum = 0; l = 0; int r = 0; sort (w, w + n); while (l < n) { while (r < n && cursum < s) { cursum += w[r]; ++r; } if (cursum >= s && cursum <= s) { for (int i = 0; i < r - l; ++i) result[i] = w[l + i]; return 1; } cursum -= a[l]; ++l; } return 0; }

Compilation message (stderr)

molecules.cpp: In function 'int find_subset(int, int, int*, int, int*)':
molecules.cpp:4:5: error: 'll' was not declared in this scope; did you mean 'l'?
    4 |     ll cursum = 0;
      |     ^~
      |     l
molecules.cpp:7:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |     sort (w, w + n);
      |     ^~~~
      |     short
molecules.cpp:10:25: error: 'cursum' was not declared in this scope
   10 |         while (r < n && cursum < s)
      |                         ^~~~~~
molecules.cpp:15:13: error: 'cursum' was not declared in this scope
   15 |         if (cursum >= s && cursum <= s)
      |             ^~~~~~
molecules.cpp:21:9: error: 'cursum' was not declared in this scope
   21 |         cursum -= a[l];
      |         ^~~~~~
molecules.cpp:21:19: error: 'a' was not declared in this scope
   21 |         cursum -= a[l];
      |                   ^