| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1354618 | putuputu | Detecting Molecules (IOI16_molecules) | C++20 | 29 ms | 5288 KiB |
#include<bits/stdc++.h>
using namespace std;
//#include "molecules.h"
vector<int> find_subset(int l, int u, vector<int> w){
long long n=(int)w.size();
vector< pair < long long, long long > > a(n, {0, -1});
for(long long i=0; i<n; i++){
a[i].first=w[i];
a[i].second=i;
}
vector<int> ans;
sort(a.begin(), a.end());
long long ll=0;
long long sum=0;
for(long long r=0; r<n; r++){
sum+=a[r].first;
while(sum>u and ll<=r ){
sum-=a[ll].first;
ll++;
}
if(sum>=l and sum<=u){
for(long long i=ll; i<=r; i++){
ans.push_back(a[i].second);
}
return ans;
}
}
return ans;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
