# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
916115 | IBory | Detecting Molecules (IOI16_molecules) | C++17 | 39 ms | 8152 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
#define pii pair<ll, ll>
typedef long long ll;
using namespace std;
vector<int> find_subset(int L, int R, vector<int> W) {
vector<pii> P;
ll low = 0, high = 0, N = W.size(), SZ = -1;
for (int i = 0; i < N; ++i) P.emplace_back(W[i], i);
sort(P.begin(), P.end());
for (int i = 0; i < N; ++i) {
low += P[i].first; high += P[N - 1 - i].first;
if (L - high <= 0 && 0 <= R - low) {
SZ = i + 1;
break;
}
}
vector<int> ret;
if (SZ == -1) return ret;
ll cur = 0;
for (int i = 0; i < SZ; ++i) cur += P[i].first;
if (L <= cur && cur <= R) {
for (int i = 0; i < SZ; ++i) ret.push_back(P[i].second);
return ret;
}
for (int n = 0; n < SZ; ++n) {
cur += P[N - 1 - n].first - P[n].first;
if (L <= cur && cur <= R) {
for (int i = n + 1; i < SZ; ++i) ret.push_back(P[i].second);
for (int i = 0; i <= n; ++i) ret.push_back(P[N - 1 - i].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... |