# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413936 | 2021-05-29T17:43:52 Z | Dakto | Detecting Molecules (IOI16_molecules) | C++17 | 1 ms | 204 KB |
#include <bits/stdc++.h> #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<pair<int,int>> v; for(int i=0; i<w.size(); i++){ v.push_back({w[i],i}); } sort(v.begin(),v.end()); auto f=v[0]; v.erase(v.begin()); vector<int> res; int s=0; while(!v.empty()){ if(s>=l) break; s+=end(v)->first; res.push_back(v.back().second); v.erase(v.end()-1); if(s>=l) break; if(s+f.first>=l){ s+=f.first; res.push_back(f.second); } } if(s>=l && s<=u) return res; else return vector<int>(0); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
2 | Correct | 1 ms | 204 KB | OK (n = 1, answer = NO) |
3 | Incorrect | 1 ms | 204 KB | Contestant can not find answer, jury can |
4 | Halted | 0 ms | 0 KB | - |