이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#include "books.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long
#define mod 1000000007
void solve(int n, int k, ll a, int S) {
int l = 1, r = n - k + 1;
ll arr[n + 1];
for(int i = 1; i <= n; i++)
arr[i] = 0;
while(l <= r) {
int mid = (l + r) / 2;
ll x = 0;
for(int i = mid; i <= mid + k - 1; i++) {
if(!arr[i])
arr[i] = skim(i);
x += arr[i];
}
if(x >= a && x <= 2 * a) {
vector<int> ans;
for(int i = mid; i <= mid + k - 1; i++)
ans.push_back(i);
answer(ans);
return;
}
if(x > a * 2)
r = mid - 1;
else
l = mid + 1;
}
impossible();
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |