Orange Boy Can You Solve It Out? Ep. 68

This is a hard version of Ep. 67.

If you prefer an easier problem, please see OBCYSIO67.

Meeting Point

Given a directed graph G of n vertices and m edges. A single vertex S is called the starting point and a single vertex T is called the finish point. A vertex u is called sqrtpoint if there exists a walk from S to u with length x and exists a walk from u to T with length x^2.

Find all sqrtpoints.

Recall that a walk is a node sequence where for all 1\leq i<n we have v_iv_{i+1}\in E. Duplicate vertices are allowed in a walk.

Constraints

n,m\leq 50

Hint

The possible length of a walk is periodic when the walk is long enough. Brute force small x and use this property for large x.

版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/1899
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>