Submission #683971

#TimeUsernameProblemLanguageResultExecution timeMemory
683971JuanDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms300 KiB
#include<bits/stdc++.h> using namespace std; vector<int> find_subset(int L, int R, vector<int> w){ int n = w.size(); 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...