| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1354642 | nini_gvenetadze | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 344 KiB |
#include<bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
int n=w.size();
long long p=0;
vector<pair<int, int>> vec(n);
for(long long i=0; i<n; i++)
{
vec[i].first=w[i];
vec[i].second=i;
}
sort(vec.begin(), vec.end());
vector<int> vec2;
long long int sum=0;
//vector
for(long long i=0; i<n; i++)
{
sum+=vec[i].first;
if(sum>=l)
{
if(sum<=u){
for(long long k=p; k<=i; k++){
vec2.push_back(vec[k].second);}
return vec2;
}
}
// long long p=0;
while(sum>u && p<=i)
{
sum-=vec[p].first;
p++;
}
if(sum>=l && sum<=u)
{
for(long long k=p; k<n; k++)
{
vec2.push_back(vec[k].second);
}
return vec2;
}
}
return vec2;
} | # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
