Submission #430884

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4308842021-06-17 07:33:57KalasLavasBoxes with souvenirs (IOI15_boxes)C++14
25 / 100
1 ms204 KiB
#include <bits/stdc++.h>
#include "boxes.h"
using namespace std;
#define F first
#define S second
using ll = long long;
using pii= pair<int,int>;
using pll= pair<ll,ll>;
int n,k,len,*p;
ll ans;
ll delivery(int _N, int _K, int _L, int _p[])
{
n=_N; k=_K; len=_L; p=_p;
int l=-1, r=n;
while(l+1<n and (p[l+1]<<1)<len) l++;
r = l+1;
while(0<=l and r<n and ((p[r]-p[l])<<1)<=len)
{
int kk = k;
ans+=len;
while(kk--)
{
if(l==-1 and r==n) break;
if(r==n or (0<=l and p[l]>(len-p[r]))) l--;
else r++;
}
}
//cerr<<l<<' '<<r<<endl;
//cerr<<ans<<endl;
while(0<=l)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...