# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1001660 | hacizadal | Detecting Molecules (IOI16_molecules) | C++17 | 41 ms | 7364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define pll pair<ll, ll>
ll p[200005];
std::vector<int> find_subset(int k, int u, std::vector<int> w) {
vector<pair<int, int>>v;
for (int i = 0; i<w.size(); i++){
v.push_back({w[i], i});
}
sort(v.begin(), v.end());
for (ll i = 0; i<v.size(); i++){
p[i+1] = p[i] + v[i].first;
}
vector<int>f;
for (ll i = 0; i<v.size(); i++){
ll l = i, r = v.size()-1;
while (l <= r){
ll m = (l + r)/2;
if (p[m+1] - p[i] >= k and p[m+1] - p[i] <= u and v[m].first - v[i].first <= (u - k)){
for (ll j = i; j<=m; j++){
f.push_back(v[j].second);
}
sort(f.begin(), f.end());
return f;
}
else if (p[m+1] - p[i] < k){
l = m + 1;
}
else {
r = m - 1;
}
}
}
return f;
}
컴파일 시 표준 에러 (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... |