| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 405029 | rainboy | Detecting Molecules (IOI16_molecules) | C11 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "molecules_c.h"
int find_subset(int lower, int upper, int *ww, int n, int *ii) {
int m, h;
long long lower_, upper_;
lower_ = upper_ = 0;
for (m = 1; m <= n; m++) {
lower_ += ww[m], upper_ += ww[n - 1 - m];
if (lower_ <= upper && upper_ >= lower) {
long long sum;
sum = 0;
for (h = 0; h < m; h++)
ii[h] = h, sum += ww[h];
for (h = m - 1; h >= 0 && sum < lower; h--)
ii[h] = n - 1 - (m - 1 - h); sum += ww[ii[h]] - ww[h];
return m;
}
}
return 0;
}
Compilation message (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... | ||||
