# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
138861 | RiscadoA | Detecting Molecules (IOI16_molecules) | C++14 | 62 ms | 5624 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
const int MAX_N = 200000;
int N;
std::pair<int, int> W[MAX_N];
std::vector<int> find_subset(int l, int u, std::vector<int> w_in)
{
N = (int)w_in.size();
for (int i = 0; i < N; ++i)
W[i] = std::make_pair(w_in[i], i);
std::sort(std::begin(W), std::begin(W) + N);
int best_x = 0, best_y = 0;
long long best_s = W[0].first;
for (long long x = 0, y = 0, s = W[0].first, d; x < N && y < N;) {
if (s > l)
s -= W[x++].first;
else
s += W[++y].first;
if (s >= l && (s < best_s || best_s < l)) {
best_x = x;
best_y = y;
best_s = s;
}
}
if (best_s < l || best_s > u)
return {};
std::vector<int> ret;
for (int x = best_x; x <= best_y; ++x)
ret.push_back(W[x].second);
return ret;
}
컴파일 시 표준 에러 (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... |