제출 #856434

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8564342023-10-03 13:21:12NeroZeinDancing Elephants (IOI11_elephants)C++17
97 / 100
2532 ms31844 KiB
#include "elephants.h"
#include "bits/stdc++.h"
using namespace std;
const int B = 350;
int n, l;
int tot, qc;
vector<int> a;
vector<int> bucket;
vector<int> nxt, cnt;
vector<int> in_bucket[B];
void calc(int bucket_num) {
int m = in_bucket[bucket_num].size();
if (m == 0) {
return;
}
int p = m - 1;
for (int i = m - 1; i >= 0; --i) {
int cur = in_bucket[bucket_num][i];
while (a[in_bucket[bucket_num][p]] - a[cur] > l) {
p--;
}
if (p == m - 1) {
cnt[cur] = 1;
nxt[cur] = a[cur] + l;
} else {
nxt[cur] = nxt[in_bucket[bucket_num][p + 1]];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...