Submission #965609

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9656092024-04-19 02:58:49weakweakweakGarden (JOI23_garden)C++17
0 / 100
1152 ms790144 KiB
//...
/*
type atybe bd+1
x[, ]yhtype byhtype ayh(dsu h - 1hh+1 mergeh - 1, h + 1merge)
ydsuhlinked list
O(d^2 (2d)) ~= O(d^2)
*/
#include <bits/stdc++.h>
using namespace std;
int n, m, d, cntax[10010] = {0}, cntbx[10010] = {0}, cntb[10010][5010] = {0}, www[5010] = {0}; //www[i]iyxlinked_list0
int ans = INT_MAX;
bool abcovery[10010] = {0};
bool acovery[10010] = {0};
struct linked_list {
int pre[5010], nxt[5010], used[5010] = {0};
void init () {
pre[0] = nxt[0] = 0;
for (int i = 1; i <= d; i++) pre[i] = nxt[i] = -1, used[i] = 0;
}
void add (int x) {
int edd = pre[0];
nxt[x] = nxt[edd], pre[nxt[edd]] = x;
pre[x] = edd, nxt[edd] = x;
used[x] = 1;
}
void del (int x) {
nxt[pre[x]] = nxt[x], pre[nxt[x]] = pre[x];
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...