Submission #991969

#TimeUsernameProblemLanguageResultExecution timeMemory
99196912345678A Difficult(y) Choice (BOI21_books)C++17
10 / 100
1 ms444 KiB
#include <bits/stdc++.h>
#include "books.h"

using namespace std;

const int nx=1e5+5;

long long n, k, a[nx], t;
set<pair<long long, long long>> s;

void solve(int N, int K, long long A, int S) {
    n=N, k=K, t=A;
    int l=k, r=n;
    while (l<=r)
    {
        long long md=(l+r)/2, sm=0;
        for (int j=0; j<k; j++) sm+=skim(md-j);
        if (sm<t) l=md+1;
        else if (sm>2*t) r=md-1;
        else
        {
            vector<int> res;
            for (int j=0; j<k; j++) res.push_back(md-j);
            answer(res);
        }
    }
    impossible();
}

/*
5 3 10 179
1 2 9 10 100
*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...