はまやんはまやんはまやん

hamayanhamayan's blog

2018-02-16から1日間の記事一覧

Permutation Cycle [ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) C]

http://codeforces.com/contest/932/problem/Cf(i,j) := P[i] (j=1) f(i,j) := f(P[i], j-1) (otherwise) と定義される関数fがある。 関数g(i)をf(i,j)=iとなる最小のjと定義する。 g(1), g(2), ..., g(N)の値がAかBのいずれかになるように順列Pを構築せよ。…

Recursive Queries [ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) B]

http://codeforces.com/contest/932/problem/Bf(n) := nの非ゼロの桁の総積 g(n) := n (n < 10) g(n) := g(f(n)) と定義する。 Q個の以下のクエリを処理せよ。 「x=[L,R]の中でg(x)=Kとなる個数を求めよ」

Palindromic Supersequence [ICM Technex 2018 and Codeforces Round #463 (Div. 1 + Div. 2, combined) A]

http://codeforces.com/contest/932/problem/A文字列Aがある。 これについて以下の条件を満たす文字列Bを答えよ。 Bの(連続でなくてもいい)部分列にAが含まれる Bは回文 Bの長さは10^4以下