Submission #697112

#TimeUsernameProblemLanguageResultExecution timeMemory
697112_Knyaz_Detecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; vector<int> find_subset(int l, int u, vector<int> w){ sort(w.begin(), w.end()); vector<int> vec; int sum = w[0], n = w.size(); if(l <= sum && sum <= u){ vec.push_back(0); return vec;} int L = 0, R = 1; while(R<n){ if(sum<=u) sum += w[R++]; if(sum>u) sum -= w[L++]; if(l<=sum && sum<=u){ for(int i = L; i < R; i++) vec.push_back(i); break; } } return vec; }
#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...