# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82861 | 2018-11-02T08:57:50 Z | SecretAgent007 | Detecting Molecules (IOI16_molecules) | C++17 | 3 ms | 504 KB |
#include "molecules.h" #include <bits/stdc++.h> using namespace std; vector<int> find_subset(int l, int r, vector<int> w){ int n = w.size(); vector< pair<int, int> > toS(0); for(int i = 0; i < w.size(); i++){ toS.push_back(make_pair(w[i],i)); } sort(toS.begin(), toS.end()); int le = 0; int ri = 0; long long sum = toS[0].first; while(1){ while(le < n && sum > r){ sum-=toS[le++].first; } while(ri < n && sum < r){ sum+=toS[++ri].first; } if(sum >= l && sum <= r){ vector<int> ans(0); for(int i = le; i <= ri; i++){ ans.push_back(toS[i].first); } return ans; } if(le >= n || ri >= n) break; } vector<int> ans(0); return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 1, answer = NO) |
2 | Correct | 2 ms | 504 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 504 KB | Integer 10 violates the range [0, 0] |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 504 KB | Integer 50 violates the range [0, 11] |
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 | 504 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 504 KB | Integer 10 violates the range [0, 0] |
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 | 504 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 504 KB | Integer 10 violates the range [0, 0] |
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 | 504 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 504 KB | Integer 10 violates the range [0, 0] |
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 | 504 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 2 ms | 504 KB | Integer 10 violates the range [0, 0] |
4 | Halted | 0 ms | 0 KB | - |