Submission #810797

#TimeUsernameProblemLanguageResultExecution timeMemory
810797wortelwormDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms428 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> find_subset(int lower, int upper, std::vector<int> w) { ll sum = 0; vector<int> answer; for (int i = w.size() - 1; i >= 0; i--) { sum += w[i]; answer.push_back(i); if (sum >= lower) { if (sum > upper) { return {}; } return answer; } } }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:9:17: warning: control reaches end of non-void function [-Wreturn-type]
    9 |     vector<int> answer;
      |                 ^~~~~~
#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...