# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122293 | 2019-06-28T04:12:09 Z | turbat | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 384 KB |
#include <bits/stdc++.h> #include "molecules.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()); long long s = 0, curr = 0; for (int i = 0;i < v.size();i++){ while (curr < v.size() && s + v[curr].first <= l) s += v[curr++].first; if (s >= l && s <= u){ for (int j = i;j < curr;j++) ans.push_back(v[j].second); return ans; } s -= v[curr].first; } return vector<int>(0); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
6 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
7 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
8 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
9 | Correct | 2 ms | 356 KB | OK (n = 3, answer = YES) |
10 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
11 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
6 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
7 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
8 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
9 | Correct | 2 ms | 356 KB | OK (n = 3, answer = YES) |
10 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
11 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
6 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
7 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
8 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
9 | Correct | 2 ms | 356 KB | OK (n = 3, answer = YES) |
10 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
11 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
6 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
7 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
8 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
9 | Correct | 2 ms | 356 KB | OK (n = 3, answer = YES) |
10 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
11 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 384 KB | OK (n = 1, answer = NO) |
3 | Correct | 2 ms | 256 KB | OK (n = 1, answer = YES) |
4 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
5 | Correct | 2 ms | 256 KB | OK (n = 2, answer = YES) |
6 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
7 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
8 | Correct | 2 ms | 256 KB | OK (n = 3, answer = YES) |
9 | Correct | 2 ms | 356 KB | OK (n = 3, answer = YES) |
10 | Correct | 2 ms | 384 KB | OK (n = 3, answer = YES) |
11 | Incorrect | 2 ms | 256 KB | Contestant can not find answer, jury can |
12 | Halted | 0 ms | 0 KB | - |