B. Mike and Children time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike decided to teach programming to children in an elementary school. He knows that it is not an easy task to interest…
题面戳这里 A. Diana and Liana 首先如果s>ks>ks>k一定无解,特判一下.那么我们考虑找恰好满足满足题目中的要求的区间[l,r][l,r][l,r],那么需要要删去的数一定是(l−1)%k+max((r−l+1)−k,0)(l-1)\%k+max((r-l+1)-k,0)(l−1)%k+max((r−l+1)−k,0).前面的表示要把[1,l−1][1,l-1][1,l−1]区间删成kkk的倍数,后面的表示要把这个区间删到kkk长度以内.判断这个值是否不大于能够删的…
Codeforces Round #539 (Div. 1) A. Sasha and a Bit of Relax description 给一个序列\(a_i\),求有多少长度为偶数的区间\([l,r]\)满足\([l,mid]\)的异或和等于\([mid+1,r]\)的异或和. solution 等价于询问有多少长度为偶数的区间异或和为\(0\). 只需要两个位置的异或前缀和与下标奇偶性相同即可组成一个合法区间. #include<cstdio> #include<algorith…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…