이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
# include <bits/stdc++.h>
# include "books.h"
 
# define pb push_back
# define ff first
# define ss second
# define nl "\n"
# define sz(x) ((int)(x).size())
# define deb(x) cerr << #x  << " = " << x << endl; 
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const ll maxn = 1e5 + 25;
const ll inf = 1e18 + 0;
const ll mod = 1e9 + 123;
const ll dx[] = {-1, 1, 0, 0};
const ll dy[] = {0, 0, -1, 1};
 
using namespace std;
map <int, ll> mp;
ll pref[maxn];
int ask (int i)
{
	if (mp.count(i)) return mp[i];
	else return mp[i] = skim(i);
}
void solve(int N, int K, long long A, int S) {
	if (S == N)
	{
		for (int i = 1; i <= N; ++i)
		{
			ask(i);	
			pref[i] = pref[i - 1] + ask(i);
		}	
		for (int i = 0; i <= K; ++i)
		{
			ll siz = K - i, pos = -1;
			ll x = A - pref[i];
			ll l = i + 1, r = N - siz + 1;
			while (l <= r)
			{
				ll mid = (l + r) >> 1;
				if (pref[mid + siz - 1] - pref[mid - 1] >= x)
				{
					r = mid - 1;
					pos = mid;
				}
				else
				{
					l = mid + 1;
				}
			}
			if (pos != -1)
			{
				if (pref[pos + siz - 1] - pref[pos - 1] + pref[i] >= A && pref[pos + siz - 1] - pref[pos - 1] + pref[i] <= A * 2)
				{
					vector <int> ans;
					for (ll j = 1; j <= i; ++j)
					{
						ans.pb(j);
					}
					for (ll j = pos; j <= pos + siz - 1; ++j)
					{
						ans.pb(j);
					}
					answer(ans);
					exit(0);
				}
			}
		}
	}
	
}
| # | 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... |