# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1001617 | vjudge1 | Detecting Molecules (IOI16_molecules) | C++17 | 64 ms | 17152 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<vector<ll>> ve;
vector<ll> pr;
int bs(int n, int si, int a, int b){
int l = si, r = n, best = -1;
while (l <= r){
int mid = (l + r) / 2;
ll res = pr[mid] - pr[mid - si];
if (res > b){
r = mid - 1;
}
else if (res < a){
l = mid + 1;
}
else{
return mid;
}
}
return -1;
}
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
vector<int> ans;
int n = w.size();
ve.push_back({0, 0});
for (int i = 0; i < n; i++){
ve.push_back({w[i], i});
}
sort(ve.begin(), ve.end());
pr.assign(n + 1, 0);
for (int i = 1; i <= n; i++){
pr[i] = pr[i - 1] + ve[i][0];
}
for (int i = 1; i <= n; i++){
int res = bs(n, i, l, u);
if (res != -1){
for (int j = res - i + 1; j <= res; j++){
ans.push_back(ve[j][1]);
}
sort(ans.begin(), ans.end());
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... |