Submission #103913

# Submission time Handle Problem Language Result Execution time Memory
103913 2019-04-03T08:58:57 Z Hideo Detecting Molecules (IOI16_molecules) C++14
0 / 100
3 ms 384 KB
#include "molecules.h"
#include <bits/stdc++.h>
//#include "grader.cpp"

using namespace std;

#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define pi pair < int, int >

int n, lf;
ll s;

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