Submission #1223164

#TimeUsernameProblemLanguageResultExecution timeMemory
122316412baaterDetecting Molecules (IOI16_molecules)C++20
0 / 100
0 ms320 KiB
#include "molecules.h"
#include <vector>

using namespace std;

vector<int> find_subset(int l, int u, std::vector<int> w) {
    vector<int> ans;
    int total = 0;
    for (int i = 0; i < w.size(); i++) {
        total += w[i];
        ans.push_back(i);
        if (total > u) return vector<int>(0);
        if (total >= l) return ans;
    }
}

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
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
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...