# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
198353 | 2020-01-25T17:01:51 Z | Ruxandra985 | Detecting Molecules (IOI16_molecules) | C++14 | 2 ms | 256 KB |
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector <int> sol; pair <int,int> x[200010]; vector <int> find_subset (int l , int u , vector <int> v){ int i , sum; for (i=0;i<v.size();i++){ x[i] = make_pair(v[i] , i); } sort (x , x + v.size()); sum = 0; for (i = v.size() - 1 ; i>=0 ;i--){ if (sum + x[i].first <= u && (sum + x[i].first >= l || sum + x[i].first + x[0].first <= u)){ sum += x[i].first; sol.push_back(x[i].second); } if (sum >= l){ return sol; } } sol.clear(); sum = 0; for (i = 0 ; i<v.size() ;i++){ if (sum + x[i].first <= u && (sum + x[i].first >= l || sum + x[i].first + x[i+1].first <= u)){ sum += x[i].first; sol.push_back(x[i].second); } if (sum >= l){ return sol; } } return sol; /// nu se poate; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | sum of weights should be in [10..12] but it is 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | OK (n = 12, answer = YES) |
2 | Correct | 2 ms | 256 KB | OK (n = 12, answer = YES) |
3 | Incorrect | 2 ms | 256 KB | sum of weights should be in [307..317] but it is 301 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | sum of weights should be in [10..12] but it is 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | sum of weights should be in [10..12] but it is 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | sum of weights should be in [10..12] but it is 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | sum of weights should be in [10..12] but it is 9 |
2 | Halted | 0 ms | 0 KB | - |