Submission #259730

#TimeUsernameProblemLanguageResultExecution timeMemory
259730lani1akeaDetecting Molecules (IOI16_molecules)C++17
0 / 100
159 ms65536 KiB
#include "molecules.h" #include <bits/stdc++.h> #define F first #define S second #define ll long long #define pb push_back #define endl '\n' #define rep(x) cerr<<#x<<"="<<x<<endl #define OK cerr<<"OK"<<endl<<flush using namespace std; const int MOD = 1e9 + 7; const int N = 510; vector<int> find_subset(int l, int u, vector<int> w) { vector<pair<vector<int>, ll>> v; vector<int> ans; for (int i = 0; i < w.size(); ++i) { int x = v.size(); for (int j = 0; j < x; ++j) { vector<int> up = v[j].F; ll sum = v[j].S; up.pb(i); sum += w[i] * 1LL; v.pb({up, sum}); if (sum >= (ll)l and sum <= (ll)u) { ans = up; goto loop1; } } vector<int> p; p.pb(i); v.pb({p, w[i]}); } loop1: return ans; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   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...