# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1198881 | HappyCapybara | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 328 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<signed> W;
vector<signed> mstv(multiset<int> ms){
vector<signed> v;
for (int i=0; i<W.size(); i++){
if (ms.find(W[i]) != ms.end()){
ms.erase(ms.find(W[i]));
v.push_back(i);
}
}
return v;
}
vector<signed> find_subset(signed l, signed u, vector<signed> w){
int n = w.size();
W = w;
sort(w.begin(), w.end());
int cur = 0;
multiset<int> res;
for (int i=0; i<n; i++){
res.insert(w[i]);
cur += w[i];
if (cur > u){
cur -= *res.begin();
res.erase(res.find(w[i]));
int j = i;
if (res.empty()) return {};
while (cur < l && j < n){
cur -= *res.begin();
res.erase(res.begin());
cur += w[j];
res.insert(w[j]);
j++;
}
if (l <= cur && cur <= u) return mstv(res);
else return {};
}
else if (l <= cur && cur <= u) return mstv(res);
}
return {};
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |