codefoeces 864B】的更多相关文章

B. Polycarp and Letters time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase an…
Codefoeces 734F 题目大意: 给定两个正整数序列\(b,c\)构造一个正整数序列\(a\)使其满足 \[ \left\{ \begin{array}{} b_i=(a_i\text{ and }a_1)+(a_i\text{ and }a_2)+...+(a_i\text{ and }a_n) \\ c_i = (a_i\text{ or }a_1)+(a_i\text{ or }a_2)+...+(a_i\text{ or }a_n) \end{array} \right. \]…
CodeFoeces 1215 D Ticket Game 题目大意 M和B轮流玩游戏(每一轮M先手 现在给出一个长度为偶数的串,包含字符'?'和数字 现在两人依次在'?'上填数字\(0\)~\(9\) 若M先手,最后串的左右两部分数字之和相等,则B赢,反之M赢 solution 难得教练给一道稍稍简单的题QwQ 最好想的状态就是: 若一开始左边的和等于右边的和 若左边的'?'数量等于右边的,那么每次M放一个数字,B放一个同样的,显然B赢 反之,两边的'?'数量不相等,那么先手赢 若一开始两边的…
Description Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters. Let A be a set of positions in the string. Let's call it pretty if following conditions are met…
D. Roads in Yusland Mayor of Yusland just won the lottery and decided to spent money on something good for town. For example, repair all the roads in the town. Yusland consists of n intersections connected by n - 1 bidirectional roads. One can travel…
D. Roads in Yusland standard output Mayor of Yusland just won the lottery and decided to spent money on something good for town. For example, repair all the roads in the town. Yusland consists of n intersections connected by n - 1 bidirectional roads…
题目: description Paladin Manao caught the trail of the ancient Book of Evil in a swampy area. This area contains n settlements numbered from 1 to n. Moving through the swamp is very difficult, so people tramped exactly n - 1 paths. Each of these paths…
B. Friends and Presents time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have two friends. You want to present each of them several positive integers. You want to present cnt1 numbers to…
gym 101466A Gaby And Addition 题目分析 题意: 给出n个数,找任意两个数 “相加”,求这个结果的最大值和最小值,注意此处的加法为不进位加法. 思路: 由于给出的数最多有 1e6 个,且每个数的值最大为 1e18 ,又因为特殊的加法运算,我们自然无法用常规的方法解决 注意到这个加法运算可以分配到每一位上进行运算,而且最大为1e18,十九位数,那么我们就可以用字典树来存储每个数,并进行计算,为了将字典树每个结点的深度和数的位数对应起来,我们可以将每个数都处理为19位数,…
A. Fair Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Petya and Vasya decided to play a game. They have n cards (n is an even number). A single integer is written on each card. Befor…