Submission #1130010

#TimeUsernameProblemLanguageResultExecution timeMemory
1130010math_rabbit_1028Sphinx's Riddle (IOI24_sphinx)C++20
10 / 100
232 ms1160 KiB
#include "sphinx.h" using namespace std; vector<int> adj[303]; vector<int> ch; void dfs(int v) { ch[v] = 1; for (int u : adj[v]) { if (ch[u]) continue; dfs(u); } } int other(int N, int v, int u) { int ret = 0; ch = vector<int>(N, 0); ch[v] = ch[u] = 1; for (int i = 0; i < N; i++) { if (ch[i]) continue; dfs(i); ret++; } return ret; } vector<int> find_colours(int N, vector<int> X, vector<int> Y) { for (int i = 0; i < X.size(); i++) { adj[X[i]].push_back(Y[i]); adj[Y[i]].push_back(X[i]); } vector<int> C(N, 0); for (int i = 0; i < N; i++) { vector<int> E(N, N); E[i] = -1; for (int j = 0; j < N; j++) { E[adj[i][0]] = j; int x = perform_experiment(E); if (x - other(N, i, adj[i][0]) == 1) C[i] = j; } } return C; }
#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...