# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1123774 | njoop | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w) {
int mn=w[0], mx=w[0];
vector<pair<int, int>> v;
vector<int> ans;
for(int i: w) {
mx = max(mx, i);
mn = min(mn, i);
}
int r = l/mn;
for(int i=0; i<w.size(); i++) {
v.push_back({w[i]-mn, i});
}
sort(v.begin(), v.end());
int sum = 0;
for(int i=0; i<r; i++) {
sum += v[i].first;
}
if(sum >= (l-(r*mn)) && sum <= (u-(r*mn))) {
for(int i=0; i<r; i++) {
ans.push_back(v[i].second);
}
return ans;
}
sum = 0;
for(int i=v.size()-r; i<v.size(); i++) {
sum += v[i].first;
}
if(sum >= (l-(r*mn)) && sum <= (u-(r*mn))) {
for(int i=v.size()-r; i<v.size(); i++) {
ans.push_back(v[i].second);
}
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... |