Submission #757247

#TimeUsernameProblemLanguageResultExecution timeMemory
757247SebDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms772 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector <int> sum[10005],aux[10005]; std::vector<int> find_subset(int l, int u, std::vector<int> w) { for (int i=0;i<w.size();i++) { for (int j=0;j<=10000;j++) { if (!sum[j].empty()) { if (w[i]+j < 10005) { aux[w[i]+j] = sum[j]; aux[w[i]+j].push_back(i); } } } for (int j=0;j<=10000;j++) { if (!aux[j].empty()) swap(aux[j],sum[j]); aux[j].clear(); } } for (int i=l;i<=u;i++) if (!sum[i].empty()) return sum[i]; return vector<int>(0); }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     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...