# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1037325 | biserailieva | Detecting Molecules (IOI16_molecules) | C++14 | 36 ms | 8248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
vector<int> ans;
vector<pair<ll, ll>> v;
ll n=w.size();
for(int i=0; i<w.size(); i++)
{
v.push_back({w[i], i});
}
sort(v.begin(), v.end());
ll i=0, j=0, sum=0;
while(j<n && i<n)
{
while(j<n && sum<l)
{
sum+=v[j++].first;
}
if(sum>=l && sum<=u && v[j-1].first-v[i].first<=u-l)
{
for(int k=i; k<j; k++)
{
ans.push_back(v[k].second);
}
return ans;
}
sum-=v[i].first;
if(sum>=l && sum<=u && v[j-1].first-v[i+1].first<=u-l)
{
for(int k=i+1; k<j; k++)
{
ans.push_back(v[k].second);
}
return ans;
}
i++;
}
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... |