Submission #418993

#TimeUsernameProblemLanguageResultExecution timeMemory
418993Mohammed_AtalahDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms296 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { std::vector<int> res; int t = 0; for (int i = 0; i < w.size(); i++) { t += w[i]; res.push_back(i); if (t <= u && t >= l) { break; } } if (t > u || t < l) { std::vector<int> v; return v; } return res; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:10:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for (int i = 0; i < w.size(); i++) {
      |                  ~~^~~~~~~~~~
#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...