#include<bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int d, vector<int> v){
int n = v.size();
int pref[n+1];
pref[0] = v[0]; pref[n] = (1 << 31)+5;
int poc = 0, kraj = 1;
for(int i=1; i<n; i++) pref[i] = pref[i-1] + v[i];
while(kraj <= n){
int sum = pref[kraj-1];
if (poc > 0) sum -= pref[poc-1];
if (sum >= l and sum <= d) return {poc, kraj};
else if (sum > d) poc++;
else kraj--;
}
return {};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1078 ms |
5516 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |