# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1132200 | lopkus | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<pair<int,int>> V;
int n = w.size();
for(int i = 0; i < n; i++) {
V.push_back({w[i], i});
}
sort(V.begin(), V.end());
int i = 0, j = 0;
int x = 0;
while(i < n && j < n) {
if(x >= l && x <= u) {
break;
}
if(x < l && j < n - 1) {
if(j + 1 == n) {
break;
}
x += V[j++].first;
}
else {
x -= V[i++].first;
}
}
vector<int> ans;
if(x >= l && x <= u) {
for(int q = i; q <= j; q++) {
ans.push_back(V[q].second);
}
}
sort(ans.begin(), ans.end());
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... |