Description Rudolf is on his way to the castle. Before getting into the castle, the security staff asked him a question: Given two binary numbers aa and bb of length nn. How many different ways of swapping two digits in aa (only in aa, not bb) so tha…
题目描述: Little Elephant and Interval time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Little Elephant very much loves sums on intervals. This time he has a pair of integers l and r (l ≤ r…
B. Maximum of Maximums of Minimums time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an array a1, a2, ..., an consisting of n integers, and an integer k. You have to split the a…
春训团队赛第四场 ID A B C D E F G H I J K L M AC O O O O O O O O O 补题 ? ? O O 传送门 题目链接(CF Gym102021) 题解链接(pdf) 代码 & 简易题解 [A]:LCA 给定一个格状迷宫,保证任意点均可达,且任意两格点间有且仅有一条简单路径. 给定一组移动序列,求按照这个序列走的累计路程. 按照题意对图预处理,得到一棵树,对于每对询问求 \(\text{LCA}\) 的同时求距离,累加即为答案. 一开始 \(\text{RE…
Coach Pang and Uncle Yang both love numbers. Every morning they play a game with number together. In each game the following will be done: 1. Coach Pang randomly choose a integer x in [a, b] with equal probability. 2. Uncle Yang randomly choose a i…
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 152357 Accepted Submission(s): 37087 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A…