摘要:
Let's say string ss has period kk if si=si+ksi=si+k for all ii from 11 to |s|−k|s|−k (|s||s| means length of string ss) and kk is the minimum positive 阅读全文
摘要:
Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisting of n vert 阅读全文
摘要:
Kate has a set SS of nn integers {1,…,n}{1,…,n}. She thinks that imperfection of a subset M⊆SM⊆S is equal to the maximum of gcd(a,b)gcd(a,b) over all 阅读全文
摘要:
Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array cc is a subarray of an array bb if cc can be 阅读全文
摘要:
Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem: There are two arrays of integers a 阅读全文
摘要:
We guessed a permutation pp consisting of nn integers. The permutation of length nn is the array of length nn where each element from 11 to nn appears 阅读全文
摘要:
Recall that the sequence bb is a a subsequence of the sequence aa if bb can be derived from aa by removing zero or more elements without changing the 阅读全文