| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1363881 | dimitri.shengelia | Detecting Molecules (IOI16_molecules) | C++20 | 28 ms | 3752 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> find_subset(int l, int u, vector <int> w) {
int n = w.size();
vector <pair <int, int>> a( n );
for ( int i = 0; i < n; i++ ) {
a[i] = { w[i], i };
}
sort ( a.begin(), a.end() );
int j = 0;
long long sum = 0;
vector <int> answer;
for ( int i = 0; i < n; i++ ) {
sum += a[i].first;
while ( j < n and sum > u ) {
sum -= a[j].first;
j++;
}
if ( sum >= l and sum <= u ) {
for ( int z = j; z <= i; z++ ) {
answer.push_back( a[z].second );
}
break;
}
}
sort ( answer.begin(), answer.end() );
return answer;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
