제출 #1130025

#제출 시각아이디문제언어결과실행 시간메모리
1130025math_rabbit_1028스핑크스 (IOI24_sphinx)C++20
24 / 100
46 ms1156 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; int s = 0, e = N-1; while (s < e) { int m = (s+e)/2; int p = s; for (int j = 0; j < N; j++) { if (i == j) continue; E[j] = p; if (p < m) p++; } int x = perform_experiment(E); if (x == m-s+1) e = m; else s = m+1; } C[i] = s; } 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...