# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1278322 | coderg300711 | Detecting Molecules (IOI16_molecules) | C++20 | 2 ms | 352 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int x, int y, vector<int> w) {
sort(w.begin(),w.end());
int n=w.size();
vector <int> ans;
int sum=w[0];
int l=0,r=0;
while(l<n && r<n){
if(x<=sum && sum<=y){
int res=0;
for(int i=l;i<=r;i++){
ans.push_back(i);
res+=w[i];
}
if(res<x || res>y)while(true);
return ans;
}
else if(sum<x && r<n-1){
r++;
sum+=w[r];
}else if(sum>y && l<r){
sum-=w[l];
l++;
}else return ans;
}
return ans;
}
컴파일 시 표준 에러 (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... |