# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319892 | 2020-11-06T16:53:08 Z | tjdgus4384 | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 492 KB |
#include<bits/stdc++.h> #include "molecules.h" using namespace std; vector<int> find_subset(int l, int u, vector<int> w) { long long sum1, sum2; vector<pair<int, int> > v; for(int i = 0;i < w.size();i++){ v.push_back({w[i], i}); } sort(v.begin(), v.end()); for(int i = 0;i < v.size();i++){ sum1 += v[i].first; sum2 += v[v.size()-1-i].first; if(sum1 > u) return vector<int>(0); if(sum2 < l) continue; else{ for(int j = i+1;j < v.size();j++){ if(sum1 >= l){ vector<int> ans; for(int k = j-i-1;k <= j-1;k++) ans.push_back(v[k].second); sort(ans.begin(), ans.end()); return ans; } sum1 += v[j].first - v[j-i-1].first; } } } return vector<int>(0); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 492 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 12, answer = YES) |
2 | Correct | 1 ms | 396 KB | OK (n = 12, answer = YES) |
3 | Correct | 1 ms | 364 KB | OK (n = 12, answer = NO) |
4 | Correct | 1 ms | 368 KB | OK (n = 12, answer = NO) |
5 | Correct | 1 ms | 492 KB | OK (n = 12, answer = YES) |
6 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 492 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 492 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 492 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 492 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 364 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |