# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1123804 | njoop | Detecting Molecules (IOI16_molecules) | C++17 | 40 ms | 4028 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
vector<int> ans;
vector<pair<int, int>> v;
for(int i=0; i<w.size(); i++) {
v.push_back({w[i], i});
}
sort(v.begin(), v.end());
int sum = 0, p1=0, p2=0;
sum += v[p2].first;
while(p2 < v.size()) {
if(sum < l) {
p2++;
sum += v[p2].first;
} else if(sum > u) {
sum -= v[p1].first;
p1++;
} else {
for(int i=p1; i<=p2; i++) {
ans.push_back(v[i].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... |