# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164671 | 2019-11-22T12:57:23 Z | aggu_01000101 | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 376 KB |
#include <iostream> #include <vector> #include <algorithm> #define int long long using namespace std; vector<int32_t> find_subset(int32_t l, int32_t u, vector<int32_t> arr){ vector<pair<int, int32_t>> arr1; for(int i = 0;i<arr.size();i++){ arr1.push_back(make_pair(arr[i], i)); } sort(arr1.begin(), arr1.end()); vector<int32_t> answer; int first = 0, last = 1; int sum = 0; while(last<=arr1.size() && first<arr.size()){ if(sum>=l && sum<=u){ for(int i = first;i<last;i++){ answer.push_back(arr1[i].second+1); } goto returnanswer; } else if(sum<l){ if(last<arr1.size()) sum+=arr1[last].first; last++; } else{ sum-=arr1[first].first; first++; } } returnanswer: return answer; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 376 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 376 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | sum of weights should be in [302..304] but it is 353 |
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 | 376 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 376 KB | Contestant can not find answer, jury can |
4 | 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 | 376 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 376 KB | Contestant can not find answer, jury can |
4 | 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 | 376 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 376 KB | Contestant can not find answer, jury can |
4 | 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 | 376 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 376 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |