# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1124882 | sinatbtfard | Detecting Molecules (IOI16_molecules) | C++20 | 44 ms | 3656 KiB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector <int> find_subset (int l, int r, vector <int> w){
ll sum = 0, n = w.size();
vector <pair <int, int>> a(n);
for (int i = 0; i < n; i++)
a[i] = {w[i], i},
sum += w[i];
sort(a.begin(), a.end());
vector <int> ans;
sum = a[0].first;
for (int i = 0, j = 0; j < n;){
if (sum < l)
sum += a[++j].first;
else if (sum > r)
sum -= a[i++].first;
else{
for (int k = i; k <= j; k++)
ans.push_back(a[k].second);
return ans;
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |