답안 #136787

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
136787 2019-07-26T08:57:18 Z Boxworld Detecting Molecules (IOI16_molecules) C++14
0 / 100
2 ms 376 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;
	}
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 12, answer = YES)
2 Correct 2 ms 376 KB OK (n = 12, answer = YES)
3 Correct 2 ms 376 KB OK (n = 12, answer = NO)
4 Correct 2 ms 376 KB OK (n = 12, answer = NO)
5 Incorrect 2 ms 252 KB Contestant can not find answer, jury can
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB OK (n = 1, answer = NO)
2 Correct 2 ms 376 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 -