# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
240242 | 2020-06-18T23:38:01 Z | Amy313 | Detecting Molecules (IOI16_molecules) | C++14 | 5 ms | 256 KB |
#include "molecules.h" #include <bits/stdc++.h> using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<pair<int, int> >M; vector<int> A; int s, n = w.size(), c; for(int i=0; i<w.size(); i++) { M.push_back(make_pair(w[i], i+1)); } sort(M.begin(), M.end()); A.clear(); if(M[0].first>u) { return A; } for(int i=n-1; i>=0; i--) { s = M[i].first; c =0; A.push_back(M[i].second); if(s<l) { for(int j=0; j<w.size(); j++) { s+=M[j].first; A.push_back(M[j].second); if(s>=l and s<=u) { c = 1; break; } else { if(s>u) { break; } } } if(c==1) { break; } } else { if(s<=u) { break; } } } return A; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 256 KB | Integer 84 violates the range [0, 12] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |