Submission #40638

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
406382018-02-06 04:00:41leejseoDetecting Molecules (IOI16_molecules)C++98
100 / 100
75 ms35884 KiB
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
vector< pair<lld, lld> > L;
lld fr[200002];
lld bk[200002];
vector<int> find_subset(int l, int u, vector<int> w) {
int N = w.size();
for (int i=0; i<N; i++){
L.push_back(make_pair(w[i], i));
}
sort(L.begin(), L.end());
for (int i=0; i<N; i++){
if (i == 0){
fr[i] = L[i].first;
bk[i] = L[N-i-1].first;
continue;
}
else{
fr[i] = fr[i-1] + L[i].first;
bk[i] = bk[i-1] + L[N-i-1].first;
}
}
vector<int> ans;
for (int k=0; k<N; k++){
if (fr[k] > u) break;
if (fr[k] >= l && fr[k] <= u){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...