Submission #589760

#TimeUsernameProblemLanguageResultExecution timeMemory
589760KrisjanisPDetecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms304 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> find_subset(int l, int u, vector<int> w) { ll n = w.size(); ll i=0,j=0,s=0; // i - next to be removed // j - next to be added bool movement=true; while(movement) { movement = false; while(j<n&&s<l) s+=w[j++], movement=1; while(i<j&&s>u) s-=w[i++], movement=1; } if(s>=l&&s<=u) { vector<int> res; for(ll k=i;k<j;k++) res.push_back(k); return res; } return vector<int>(0); }
#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...