Submission #491273

# Submission time Handle Problem Language Result Execution time Memory
491273 2021-12-01T09:36:14 Z tempus Detecting Molecules (IOI16_molecules) C++14
0 / 100
0 ms 204 KB
#include "molecules.h"
#include <bits/stdc++.h>
#define ll int

using namespace std;

std::vector<int> find_subset(int l, int u, std::vector<ll> w) {
    int n = w.size();
    pair <ll, int> a[n];
    for (int i = 0; i < n; ++ i) {
    	if (l <= w[i] && w[i] <= u) {
    		return vector <int>(1, i + 1);
    	}
    	a[i].first = w[i];
    	a[i].second = i;
    }
    sort(a, a + n);
    ll sum = 0;
    vector <int> ans;
    for (int i = n - 1; i >= 0; -- i) {
    	sum += a[i].first;
    	ans.push_back(a[i].second);
    	if (l <= sum && sum <= u) {
    		return ans;
    	}
    }
    return vector <ll> (0);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB OK (n = 1, answer = NO)
2 Correct 0 ms 204 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 204 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB OK (n = 1, answer = NO)
2 Correct 0 ms 204 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 204 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB OK (n = 1, answer = NO)
2 Correct 0 ms 204 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 204 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB OK (n = 1, answer = NO)
2 Correct 0 ms 204 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 204 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB OK (n = 1, answer = NO)
2 Correct 0 ms 204 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 204 KB Integer 1 violates the range [0, 0]
4 Halted 0 ms 0 KB -