Submission #1157086

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11570862025-02-25 08:34:22alexddDancing Elephants (IOI11_elephants)C++20
100 / 100
6388 ms8896 KiB
#include "elephants.h"
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int BUC = 400;
const int CNT_BUC = 400;
const int RECALC_TIME = 400;
int n,L;
int a[150005];
struct bucket
{
vector<int> v;
int cnt[BUC+RECALC_TIME+5],ri[BUC+RECALC_TIME+5];
void calc_dp()
{
assert((int)v.size() < BUC + RECALC_TIME + 5);
sort(v.begin(),v.end());
int poz = (int)v.size();
for(int i=(int)v.size()-1;i>=0;i--)
{
while(poz-1>=0 && v[poz-1] > v[i] + L)
poz--;
if(poz == (int)v.size())
{
cnt[i] = 1;
ri[i] = v[i] + 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...