2019-03-09から1日間の記事一覧

Codeforces Round #545 C. Museums Tour

https://codeforces.com/contest/1137/problem/C We do not need to use GCD or something. We prepare the graph with N×D vertices and do SCC on it. Then, we can do dynamic programming on the contracted graph. The total time complexity is O(ND),…

Codeforces Round #545 (Div. 1) B. Camp Schedule

Problem Link: https://codeforces.com/contest/1137/problem/BThere are a lot of ways to solve this problem. For example, we can use Z-algorithm, rolling hash and suffix array (suffix array might be too slow for this constraints). This proble…