Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[問題案] Enumerate Cliques #820

Closed
SSRS-cp opened this issue Jul 29, 2022 · 5 comments
Closed

[問題案] Enumerate Cliques #820

SSRS-cp opened this issue Jul 29, 2022 · 5 comments

Comments

@SSRS-cp
Copy link
Collaborator

SSRS-cp commented Jul 29, 2022

問題ID: enumerate_cliques
問題名: Enumerate Cliques

問題概要

N 頂点 M 辺の単純無向グラフが与えられる。各頂点に整数 x_i がある。
グラフのそれぞれのクリークに対し、属する頂点の x_i の積を求め、総和 mod 998244353 を出力せよ。

入力

#442 と同じ

出力

答えを出力

制約

1 <= N <= 100
1 <= M <= 100
0 <= x_i < 998244353
0 <= u_i < N
0 <= v_i < N
u_i != v_i
{u_i, v_i} != {u_j, v_j} (i != j)

メモ

計算量はたぶん O(2^√(2M)*N) です

出題例: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2306

@SSRS-cp
Copy link
Collaborator Author

SSRS-cp commented Jul 29, 2022

衝突確率の評価はしていないので、もっと良い答えさせ方があるかもしれません

@maspypy
Copy link
Sponsor Collaborator

maspypy commented Jul 30, 2022

衝突確率

これは N/MOD 以下です。
https://en.wikipedia.org/wiki/Schwartz%E2%80%93Zippel_lemma

@yosupo06
Copy link
Owner

@yosupo06
Copy link
Owner

よさそうです

@shirotsume4
Copy link
Contributor

shirotsume4 commented Aug 12, 2022

問題文は以下の通りでよいですかね?概ね enumerate triangles に則っています

$N$ 頂点 $M$ 辺の単純無向グラフ $G$ が与えられます。 $i$ 番目の辺は ${u_i, v_i }$ です。$G$ の各頂点 $i$ には整数 $x_i$ が割り当てられています。

$G$ のクリーク $C$ すべてに対する $\prod_{i \in C} x_i$ の総和を $998244353$ で割った余りを求めてください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants