Submission #136789

# Submission time Handle Problem Language Result Execution time Memory
136789 2019-07-26T08:58:32 Z Boxworld Detecting Molecules (IOI16_molecules) C++14
0 / 100
2 ms 380 KB
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vec;
struct node{int val,id;}a[500100];
bool cmp(node x,node y){return x.val<y.val;}
long long s[500100];
vec find_subset(int l,int u,vec w) {
	int n=w.size();
	for (int i=1;i<=n;i++){
		a[i].val=w[i];a[i].id=i-1;
	}
	sort(a+1,a+n+1,cmp);
	s[0]=0;
	for (int i=1;i<=n;i++)s[i]=s[i-1]+a[i].val;
	for (int i=1;i<=n;i++)
	for (int j=i;j<=n;j++)
	if (s[j]-s[i-1]<=u){
		if (s[j]-s[i-1]>=l){
			vec ans;
			for (int k=i;k<=j;k++)ans.push_back(a[k].id);
			return ans;
		}
	}else break;
	vector<int> S;
    return S;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 380 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 376 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB sum of weights should be in [302..304] but it is 301
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 380 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 376 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 380 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 376 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 380 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 376 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB OK (n = 1, answer = NO)
2 Correct 2 ms 380 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 376 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -