Submission #1019867

#TimeUsernameProblemLanguageResultExecution timeMemory
1019867vjudge1Detecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#define int long long using namespace std; vector <int> find_subset(int l, int u, vector <int> w) int sum = 0; vector <int> id; for (int i = 0; i < w.size(); i++) { id.push_back(i); sum+=w[i]; if (sum>=l and sum <= u) { return id; } } return {}; } /* signed main() { int t; cin >> t; while(t--) { //solve(); } } * */

Compilation message (stderr)

molecules.cpp:7:5: error: expected initializer before 'int'
    7 |     int sum = 0;
      |     ^~~
molecules.cpp:9:5: error: expected unqualified-id before 'for'
    9 |     for (int i = 0; i < w.size(); i++) {
      |     ^~~
molecules.cpp:9:21: error: 'i' does not name a type; did you mean 'id'?
    9 |     for (int i = 0; i < w.size(); i++) {
      |                     ^
      |                     id
molecules.cpp:9:35: error: 'i' does not name a type; did you mean 'id'?
    9 |     for (int i = 0; i < w.size(); i++) {
      |                                   ^
      |                                   id
molecules.cpp:16:5: error: expected unqualified-id before 'return'
   16 |     return {};
      |     ^~~~~~
molecules.cpp:17:1: error: expected declaration before '}' token
   17 | }
      | ^