답안 #281541

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
281541 2020-08-23T07:33:49 Z AKaan37 Detecting Molecules (IOI16_molecules) C++17
0 / 100
0 ms 256 KB
//Bismillahirrahmanirrahim

#include "molecules.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define endl "\n"
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t;
int cev;
vector<int> vv;
priority_queue<PII> pq;
string s;

std::vector<int> find_subset(int l, int u, std::vector<int> v) {
	sort(v.begin(),v.end());
    for(int i=0;i<(int)v.size();i++){
		if(v[i]<=u)cev+=v[i];
		else continue;
		flag=0;
		while(pq.size() && cev>u){
			cev+=pq.top().fi;
			flag=1;
			pq.pop();
		}
		//~ cout<<cev<<" : ; "<<i<<endl;
		if(cev>=l && cev<=u){
			while(pq.size()){vv.pb(pq.top().se);pq.pop();}
			return vv;
		}
		if(flag){
			cev-=v[i];
		}
		else pq.push({-v[i],i});
	}
	return vv;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB sum of weights should be in [302..304] but it is 251
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Contestant can not find answer, jury can
4 Halted 0 ms 0 KB -