Submission #783912

#TimeUsernameProblemLanguageResultExecution timeMemory
783912AlfraganusDetecting Molecules (IOI16_molecules)C++14
19 / 100
1 ms340 KiB
#include "molecules.h" // #include "grader.cpp" #include<bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() vector<int> find_subset(int l, int u, vector<int> w) { int n = w.size(), j = 0, i = 0, s = 0; vector<pair<int, int>> a(n); for(int i = 0; i < n; i ++)a[i] = {w[i], i}; while(i < n){ s += a[i].first; i ++; while(s > u)s -= a[j ++].first; if(l <= s and s <= u){ vector<int> ans; for(int x = j; x < i; x ++){ ans.push_back(a[x].second); } return ans; } } return {}; }
#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...