# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1264541 | happyboy | Detecting Molecules (IOI16_molecules) | C++20 | 34 ms | 5192 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
pair<long long,int> p[200005];
bool o(pair<long long,int> a,pair<long long,int> b){
return a.f<b.f;
}
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n = w.size();
for (int i=0;i<n;i++){
p[i]={w[i],i};
}
sort(p,p+n,o);
int l1=0,r1=0;
long long sum=p[0].f;
while (l1<=r1){
if (sum>=l&&sum<=u){
vector<int> rtn;
for (int i=l1;i<=r1;i++) rtn.push_back(p[i].s);
return rtn;
}
else if (sum<l&&r1<n) sum+=p[++r1].f;
else sum-=p[l1++].f;
}
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... |