Submission #297933

# Submission time Handle Problem Language Result Execution time Memory
297933 2020-09-12T08:00:03 Z dandrozavr Detecting Molecules (IOI16_molecules) C++14
0 / 100
1 ms 256 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define ld long double
#define fi first
#define se second
#define F first
#define S second
#define pii pair < int , int >
#define _ <<" "<<
#define TIME 1.0 * clock() / CLOCKS_PER_SEC

#include "molecules.h"

std::vector<int> find_subset(int l, int u, std::vector<int> w) {
    vector < int > nul;
    ll sum = 0;
    int now = 0;
    int n = w.size();
    sort(w.begin(), w.end());
    for (int i = 0; i < n; ++i){
        sum += w[i];
        while(sum > u) sum -= w[now++];
        if (sum >= l){
            for (; now <= i; ++now)
                nul.pb(w[now]);
            return nul;
        }
    }
    return nul;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 1 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 50 violates the range [0, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 1 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 1 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 1 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 1 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -