Submission #683972

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