Submission #1203920

#TimeUsernameProblemLanguageResultExecution timeMemory
1203920arkanefuryDetecting Molecules (IOI16_molecules)C++20
Compilation error
0 ms0 KiB
#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
    int n = w.size();
    int ans = 0;
    vector<int>v;
    for(int i = 0; i < n; i ++){
        ans += w[i];
        v.push_back(w[i]);
        if(l <= ans && ans <= u)return v;
    }
    return ({0});
}

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:12:15: error: expected ';' before '}' token
   12 |     return ({0});
      |               ^
      |               ;
molecules.cpp:12:16: error: could not convert '0' from 'int' to 'std::vector<int>'
   12 |     return ({0});
      |                ^
      |                |
      |                int
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~