Sereja ans Anagrams

2020 VietMX 0

Sereja has two sequences a and b and number p. Sequence a consists of n integers a 1, a 2, …, a n. Similarly, sequence b consists of m integers b 1, b 2, …, b m. As usual, Sereja studies the sequences he has. Today he wants to find the number […]

Irreducible Anagrams

2020 VietMX 0

Let’s call two strings $s$ and $t$ anagrams of each other if it is possible to rearrange symbols in the string $s$ to get a string, equal […]