树链剖分
UVA 11475 - Extend to Palindrome
题目描述
Your task is, given an integer N, to make a palidrome (word that reads the same when you reverse it) of length at least N. Any palindrome will do. Easy, isn’t it? That’s what you thought before you passed it on to your inexperienced team-mate. When the contest is almost over, you find out that, that problem still isn’t solved. The problem with the code is that the strings generated are often not palindromic. There’s not enough time to start again from scratch or to debug his messy code. Seeing that the situation is desperate, you decide to simply write some additional code that takes the output and adds just enough extra characters to it to make it a palindrome and hope for the best. Your solution should take as its input a string and produce the smallest palindrome that can be formed by adding zero or more characters at its end.
UVA 8519 - Arrangement for Contests
题目描述
As a sponsor of programming contests, Yu has many factors to consider. Recently, he has found that the difficulties of problems can be a serious factor.
For novices, they may simply ignore the problems that are too hard; and for experts in programming contests, an easy problem almost means nothing. Moreover, if a contest consists of both easy and hard questions, it will not satisfy them — but make them unhappy for both reasons.
Therefore, Yu has come up with an idea: holding different kinds of contests! Novices tend to participant in a contest is known as an easy one, but will not join a hard one.
2019 ICPC 南昌邀请赛 F.Sequence
题目描述
Oldjang has a sequence $A$ of length $n$, the $i_{th}$ number in which is $A_i$. He defined a function $f(l,r) = a_l \oplus a_{l+1} \oplus \cdots \oplus a_r$. It is simple for the cleverest boy oldjang to calculate the function, so he wants to make the problem more difficult for fun. He will perform two operations:
The operation expressed as “$0 \ x \ y$”, which means he changes the $x_{th}$ number to $y$;
The operation expressed as “$1 \ l \ r$”, which means he wants to calculate the function $F(l,r)$. $F(l,r) = f(l,l) \oplus f(l,l +1) \oplus \cdots \oplus f(l,r)\oplus f(l + 1,l +1) \oplus \cdots f(l + 1,r) \oplus \cdots \oplus f(r,r)$.That means $F(l,r)$ equals to the x or sum of all $f(i,j)$ satisfied $l \le i \le j \le r$.