Submission #299613

# Submission time Handle Problem Language Result Execution time Memory
299613 2020-09-15T10:41:05 Z Valee Detecting Molecules (IOI16_molecules) C++14
0 / 100
1 ms 384 KB
#include "molecules.h"
#include <bits/stdc++.h>

#define ll long long

using namespace std;

vector<int> find_subset(int l, int u, vector<int> v) {
	bool ok = false;
	vector<int>ans;
	int n = (int)v.size();
	sort(v.begin(), v.end());
	int lb = 1, rb = n, lans = 0, rans = 0;
	while (lb < rb && !ok){
		ll m = (lb+rb)>>1, sz = 0, sum = 0;
		for (int i = 0; i < n; i++){
			sz++;
			if (sz <= m) sum += v[i];
			else sum += v[i]-v[i-m];
			if (l <= sum && sum <= u){
				lans = max(0LL, i-m+1); rans = i;
				ok = true;
				break;
			}
		}
		if (sum > u) rb = m;
		else lb = m+1;
	}
	if (ok)
		for (int i = lans; i <= rans; i++)
			ans.push_back(i);
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB OK (n = 12, answer = YES)
2 Correct 1 ms 256 KB OK (n = 12, answer = YES)
3 Correct 1 ms 256 KB OK (n = 12, answer = NO)
4 Correct 1 ms 256 KB OK (n = 12, answer = NO)
5 Correct 1 ms 256 KB OK (n = 12, answer = YES)
6 Correct 1 ms 256 KB OK (n = 12, answer = YES)
7 Correct 1 ms 256 KB OK (n = 12, answer = YES)
8 Correct 1 ms 256 KB OK (n = 12, answer = YES)
9 Incorrect 1 ms 384 KB Contestant can not find answer, jury can
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -