Submission #260044

# Submission time Handle Problem Language Result Execution time Memory
260044 2020-08-09T06:20:08 Z lani1akea Detecting Molecules (IOI16_molecules) C++17
0 / 100
0 ms 256 KB
#include "molecules.h"
#include <bits/stdc++.h>

#define F first
#define S second
#define ll long long
#define pb push_back
#define endl '\n'
#define rep(x) cerr<<#x<<"="<<x<<endl
#define OK cerr<<"OK"<<endl<<flush
using namespace std;

const int MOD = 1e9 + 7;
const int N = 510;

vector<int> find_subset(int l, int u, vector<int> w) {
	int n = w.size();
	vector<pair<int, int>> v;	
	for (int i = 0; i < n; ++i)
		v.pb({w[i], i});
	sort(v.begin(), v.end());
	ll sum = (ll)v[0].F, le = 0, ri = 1;
	while(l < n) {
		while(ri < n and sum < l) sum += (ll)v[ri++].F;
		if (sum >= l and sum <= u) break;
		sum -= (ll)v[le++].F;
	}

	vector<int> res;
	for (int i = le; i <= ri; ++i)
		res.pb(v[i].S);

	return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 2 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB sum of weights should be in [302..304] but it is 100
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 2 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 2 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 2 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 2 violates the range [0, 1]
2 Halted 0 ms 0 KB -