Submission #1124790

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11247902024-12-07 06:41:26Mousa_AboubakerSphinx's Riddle (IOI24_sphinx)C++20
18 / 100
6 ms412 KiB
#include "sphinx.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_colours(int N, vector<int> X, vector<int> Y)
{
int n = N, m = (int)X.size();
vector<int> x = X, y = Y;
vector<int> par(n), sz(n, 1);
iota(par.begin(), par.end(), 0);
auto find = [&](auto self, int u) -> int
{
return par[u] = (par[u] == u ? u : self(self, par[u]));
};
auto unite = [&](int u, int v) -> bool
{
u = find(find, u);
v = find(find, v);
if(u == v)
return false;
if(sz[u] > sz[v])
swap(u, v);
sz[v] += sz[u];
par[u] = v;
return true;
};
vector adj(n, vector<int>());
for(int i = 0; i < m; i++)
{
adj[x[i]].push_back(y[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...