Problem This problem is from Leetcode There is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. In each day, there will be exactly one flower blooming and it …


Repeated String Match
Problem Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return 1. For example, …

Minimum Genetic Mutation
Problem statement This problem is from Leetcode A gene string can be represented by an 8character long string, with choices from “A”, “C”, “G”, “T”. Suppose we need to investigate about a mutation (mutation …

939D
Problem: D. Love Rescue time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Valya and Tolya are an ideal pair, but they quarrel sometimes. Recently, Valya …

939C
Problem: C. Convenient For Everybody time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In distant future on Earth day lasts for n hours and that’s why there …

916A
Problem: A. Jamie and Alarm Snooze time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Jamie loves sleeping. One day, he decides that he needs to …

913C
Problem: C. Party Lemonade time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output A New Year party is not a New Year party without lemonade! As …

913B
Problem: B. Christmas Spruce time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Consider a rooted tree. A rooted tree has one special vertex called the …

913A
Problem: A. Modular Exponentiation time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output The following problem is wellknown: given integers n and m, calculate ,where 2n = 2·2·…·2 (n factors), and denotes the remainder …

908A
题： A. New Year and Counting Cards time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Your friend has n cards. You know that each card has a …