| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1354615 | putuputu | Detecting Molecules (IOI16_molecules) | C++20 | 24 ms | 3496 KiB |
#include<bits/stdc++.h>
using namespace std;
//#include "molecules.h"
vector<int> find_subset(int l, int u, vector<int> w){
int n=(int)w.size();
vector< pair < int, int > > a(n, {0, -1});
for(int i=0; i<n; i++){
a[i].first=w[i];
a[i].second=i;
}
vector<int> ans;
sort(a.begin(), a.end());
int ll=0;
int sum=0;
queue<int> q;
for(int 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(int i=ll; i<=r; i++){
ans.push_back(a[i].second);
}
return ans;
}
}
return ans;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
