| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1258297 | sohamsen15 | Detecting Molecules (IOI16_molecules) | C++20 | 37 ms | 6172 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<int> find_subset(int low, int high, vector<int> w) {
vector<pair<ll, ll>> a;
for (ll i = 0; i < w.size(); i++) a.push_back({ w[i], i });
sort(a.begin(), a.end());
ll l = 0, r = 0, n = a.size(), s = a[0].first; bool done = false;
while (r < n) {
if (s >= low && s <= high) {
done = true;
break;
}
if (s > high) s -= a[l].first, l++;
else r++, s += a[r].first;
}
if (!done) return vector<int>(0);
vector<int> ans;
for (ll i = l; i <= r; i++) ans.push_back(a[i].second);
sort(ans.begin(), ans.end());
return ans;
}
// int main() {
// vector<int> ans = find_subset(10, 20, {15, 17, 16, 18});
// for (auto x: ans) cout << x << " ";
// }
컴파일 시 표준 에러 (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... | ||||
