现在请你喊出某次神秘活动中的口号"fengqibisheng, yingyueerlai!"(不包含引号)。
本题没有输入。
输出"fengqibisheng, yingyueerlai!"(不包含引号)。
(no input)
fengqibisheng, yingyueerlai!
$$$XPL$$$ 是一名老年大乱斗玩家。最近新赛季推出了一件能够让英雄无限叠加生命值的新装备——心之钢 。对于变大变肉有着谜之执念的 $$$XPL$$$ 当然义无反顾地加入了钢门。
这天,$$$XPL$$$ 兴奋地对室友说自己刚玩了一把"爽局",室友好奇 $$$XPL$$$ 的英雄最终拥有多少生命值,粗心的 $$$XPL$$$ 却说他已经忘了。好在室友从他的游戏文件中找到了那一局的对局日志、英雄的初始生命值 $$$H_1$$$ 和成长生命值 $$$H_2$$$,所以我们可以借助这些信息计算出 $$$XPL$$$ 那一局最终的生命值,但是室友太菜了,所以向你寻求帮助,你可以告诉他答案吗?
一篇对局日志包含了 $$$m$$$ 个事件,且保证只会出现以下三种事件:
第一行输入三个整数 $$$H_1\ (500\le H_1\le 1000)$$$ — 初始生命值,$$$H_2\ (1\le H_2\le 100)$$$ — 成长生命值,$$$m\ (0\le m\le 1000)$$$ — 事件的个数。
接下来 $$$m$$$ 行,第 $$$i$$$ 行输入一个字符串 $$$mm:ss\ (00:00\le mm:ss\le 60:00)$$$ — 时间线(保证分钟和秒钟都以两位整数的形式给出),一个整数 $$$type\ (1\le type\le 3)$$$ — 事件类型,若 $$$type\ =\ 3$$$ 则再输入一个整数 $$$x\ (1\le x\le 5)$$$ — 敌方英雄编号。
输入保证事件1只会出现至多一次,事件按时间顺序给出,且每秒只会发生一个事件。
输出一个整数,表示对局最终英雄的生命值。
500 10 3 11:45 2 14:19 2 19:18 3 1
520
1000 100 7 00:00 2 00:30 3 1 01:00 1 01:30 2 01:40 3 1 01:45 3 2 01:50 3 1
2048
为了方便计算,触发心之钢提供的生命值都向下取整。如当前生命值为 $$$114514$$$,触发一次心之钢则会造成 $$$125\ +\ 0.06\ \times\ 114514\ =\ 125\ +\ 6870.84\ =\ 6995.84$$$ 的伤害,并提供 $$$\lfloor 6995.84\ \times \ 0.1\rfloor \ =\ \lfloor 699.584\rfloor =\ 699$$$ 的生命值。
add 9 zeros 众所周知一个程序的时间复杂度十分重要,评测机 $$$1s$$$ 大概能做 $$$10^8$$$ 次简单运算,所以根据题目所提供的数据范围你就应该精心的策划好你所写程序应该具有的时间复杂度,而在数据范围变大时,想要在时限内完成同样的一个题目,你就不得不设计出一个更快更巧妙的程序,在本题中我们认定数据范围不一样的题目不是同样的题。
现在卡夫卡有一个包含 $$$n$$$ 个不同题目的题集A ,其中第 $$$i$$$ $$$(1 \le i \le n)$$$ 个题的数据范围为 $$$10^{a_i}$$$,也就是说第 $$$i$$$ 个题有 $$$a_i$$$ 个 $$$0$$$,数据保证 $$$a_i$$$ 两两不同。
现在他想从题集A里面选出一些题目,然后把选出的题目后面加 $$$9$$$ 个 $$$0$$$,然后加入到一个新题集B里面,但是不能有原题,即这个题数据范围加 $$$9$$$ 个 $$$0$$$ 后的题不能在题集A里面有同样的题,请问卡夫卡所创造的新题集B里面最多能有多少个题。
第一行包含一个整数 $$$n\ (1 \le n \le 5\times 10^5)$$$ — 表示题集A中的题目个数。
第二行包含 $$$n$$$ 个整数 $$$a_1, a_2, a_3, ..., a_n\ (1\le a_i \le 10^9)$$$ — 表示每个题数据范围中 $$$0$$$ 的个数,保证 $$$n$$$ 个数互不相同。
输出一行一个整数 — 表示题集B中最多能有多少个题。
9 11 4 5 14 1 9 19 8 10
6
There is a matrix in the 2D plane, whose vertices labelled as $$$(0,0)$$$, $$$(n, 0)$$$, $$$(0, m)$$$ and $$$(n, m)$$$.
$$$333lfy$$$ has $$$q$$$ segments. The length of the $$$i$$$-th segment is $$$a_i$$$. He wants to place these segments in this 2D plane.
There are following four ways to place the $$$i$$$-th segment:
After placing all segments, the matrix is divided into several parts by these segments. Now please calculate the area of the largest part.
The first line of the input contains three integers $$$n, m, q$$$ $$$(1 \le n, m \le 10^6, 1 \le q \le 2000)$$$ — The size of the matrix and the number of the segments.
The next $$$q$$$ lines each line contains three integers, and the $$$i$$$-th line belong to one of the following four types:
Print one integer — the number satisfying the conditions above.
4 7 5 2 1 1 6 3 6 2 4 3 3 3 2 3 2 2
14
The example is shown in the figure:
$$$333lfy$$$ has $$$n$$$ straight lines with infinite length. Now he's going to put them in a 2D plane.
$$$333lfy$$$ wants you to select some lines from the given lines to form a convex polygon with the largest area. You just have to tell him the area of this convex polygon.
A convex polygon is a polygon having no internal angles greater than $$$180$$$ degrees. For example, the polygon in the left picture is a convex polygon, but the polygon in the right picture is not.
![]() | ![]() |
The first line of the input contains one integer $$$n$$$ $$$(3 \le n \le 500)$$$ — The number of the straight lines.
The next $$$n$$$ lines each line contains four integers $$$x_1, \ y_1, \ x_2, \ y_2$$$ $$$(-1000 \le x_1, y_1, x_2, y_2 \le 1000)$$$ — A straight line passing through points $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$. It is guaranteed that these two points are different.
It is guaranteed that these straight lines can form at least one convex polygon.
Print a real number — the number satisfying the conditions above.
Your answer is acceptable if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally speaking, suppose that your output is $$$x$$$ and the jury's answer is $$$y$$$; your output is accepted if and only if $$$\frac{|x - y|}{max(1, |y|)} \le 10^{-6}$$$.
4 1 3 3 2 -1 2 0 1 7 5 8 6 1 -1 3 -1
24.5000000000
The test case is shown in the figure:
testcase
There are $$$n$$$ players fighting the boss, and each player has its hp value. Initially, the hp value of $$$i$$$-th player equals $$$a_i$$$. There is no upper limit for the hp value of each player.
At the end of each minute, the $$$i$$$-th person will suffer $$$b_i$$$ damage; that is, the hp value of $$$i$$$-th person will decrease $$$b_i$$$. Once a player's hp value is less than or equal to $$$0$$$, he will permanently quit the fight.
You have magical skills. You can select the $$$i$$$-th player (if he is alive) and increase his hp value by $$$c_i$$$. You can use it multiple times at any minute, but the total number of times cannot exceed $$$k$$$.
Now you need to determine the maximum number of players that can survive after $$$m$$$ minutes.
The first line of the input contains three integers $$$n, m, k$$$ $$$(1\le n\le 2\times 10^5, 1\le k, m \le 10^6)$$$.
The second line contains $$$n$$$ integers $$$a_1,a_2,...,a_n$$$ $$$(1\le a_i \le 10^9)$$$.
The third line contains $$$n$$$ integers $$$b_1,b_2,...,b_n$$$ $$$(1\le b_i \le 10^9)$$$.
The forth line contains $$$n$$$ integers $$$c_1,c_2,...,c_n$$$ $$$(1\le c_i \le 10^9)$$$.
Print one integer — the number satisfying the conditions above.
3 5 2 1 1 4 1 9 1 5 1 4
2
For the first test case, at the beginning of the first minute, you can use skills on the first and third players, then they will survive.
给一个拥有 $$$n$$$ 层的红黑树,第一层有一片叶子,第二层有两片叶子....第 $$$n$$$ 层有 $$$n$$$ 片叶子。第 $$$i$$$ 行第 $$$j$$$ 片叶子表示为 $$$(i, j)$$$ , 如下图1.1,所以除了第 $$$n$$$ 层的叶子之外,每一片叶子下面都拥有两片叶子,即叶子 $$$(i, j)$$$ 下面的叶子是 $$$(i+1,j)$$$ 和 $$$(i+1,j+1)$$$ 。
图1.1 之后给定 $$$k$$$ 片叶子的位置 $$$(x, y)$$$,表示该叶子为黑色,其他叶子为红色。
现给定两条规则
现在可以将部分红色叶子染黑,使得每一个黑色叶子都满足上面的规则,同时让染黑的叶子数量最少。
问最终树上黑色叶子数量是多少?
第一行包含两个整数 $$$n, k\ (1 \le n \le 10^6;1 \le k \le min(10^6, \frac{n \times (n + 1)}{2}))$$$ — 表示层数和初始黑色叶子的数量。
接下来 $$$k$$$ 行,每行包含两个整数 $$$x, y\ (1\le y \le x \le n)$$$ — 表示黑色叶子的位置在 $$$(x, y)$$$,数据保证不重复。
输出最终树上黑色叶子的数量。
5 3 2 1 3 1 4 1
10
3 1 1 1
6
In this problem, the alphabet contains only the first $$$18$$$ lowercase Latin letters; that is, the alphabet has only the characters from $$$a$$$ to $$$r$$$.
In this problem, the string index starts from $$$1$$$.
$$$Hile$$$ has a string $$$s$$$. She thinks a string $$$t$$$ of $$$n$$$ distinct letters is a beautiful string if any of the following conditions are met:
$$$t_i\ (1 \le i \le n)$$$ means the $$$i$$$-th character in the string $$$t$$$.
Now $$$Hile$$$ wants you to calculate the number of beautiful strings.
The first line contains an integer $$$T\ (1\le T\le 2 \times 10^5)$$$ — the number of test cases.
Each test case is one line contains one string $$$s$$$ $$$(1 \le |s| \le 2\times 10^5)$$$ and one integer $$$n\ (1\le n \le 18)$$$ — the string $$$s$$$ and the length of string $$$t$$$.
It is guaranteed that $$$\sum{|s|} \le 2 \times 10^5$$$, $$$|s|$$$ means the length of the string $$$s$$$.
For each test case, output an integer — the number of beautiful strings.
2a 2ar 2
17 18
In the first testcase, the beautiful string $$$t$$$ are: $$$ab,\ ac,\ ad,\ ae,\ af,\ ag,\ ah,\ ai,\ aj,\ ak,\ al,\ am,\ an,\ ao,\ ap,\ aq,\ ar$$$.
In the second testcase, the beautiful string $$$t$$$ are: $$$ab,\ ac,\ ad,\ ae,\ af,\ ag,\ ah,\ ai,\ aj,\ ak,\ al,\ am,\ an,\ ao,\ ap,\ aq,\ ar,\ ra$$$.
有三个二进制数 $$$x, y, z$$$ $$$(y \le x, z = x - y)$$$ (可能含有前导零)。
现在你知道 $$$x$$$ 和 $$$y$$$ 的二进制表示中都有 $$$a$$$ 个 $$$1$$$,$$$b$$$ 个 $$$0$$$ $$$(a + b \gt 0)$$$,另外你还知道 $$$z$$$ 的二进制表示中有 $$$c$$$ 个 $$$1$$$。
请问你能否找出一组合法的 $$$x, y$$$ 满足上述条件, 若不存在输出"-1"(不包含引号)。
一行三个整数 $$$a, b, c$$$ $$$(0 \le a, b, c \le 5 \times 10^5, a + b \gt 0)$$$。
若存在合法解,输出两行,第一行为数 $$$x$$$ 的二进制形式,第二行为数 $$$y$$$ 的二进制形式。输出的两个数的长度必须为 $$$a+b$$$ ,可以含有前导零。
若不存在合法解,输出一行"-1"(不包含引号)。
注意输出格式
1 2 2
100 001
1 2 3
-1
Alice and Bob are playing a game on a sequence $$$a_1,a_2 \cdots a_n$$$ of length $$$n$$$. They move in turns, and Alice moves first.
At each player's turn, they should select an integer and remove it from the sequence. The game ends when there is no integer left in the sequence.
Assume the sum of integers selected by Alice is $$$S_1$$$, and the sum of integers selected by Bob is $$$S_2$$$.
If the difference between $$$S_1$$$ and $$$S_2\ (ie.\lvert S_1 - S_2 \rvert)$$$ is odd, Alice wins; Otherwise, Bob wins.
Your task is to determine who will win the game if both players play optimally.
The first line contains an integer $$$n\ (1 \le n \le 10^6)$$$, indicating the length of the sequence.
The second line contains $$$n$$$ integers $$$a_1,a_2 \cdots a_n\ (1 \le a_i \le 10^9)$$$, indicating the elements of the sequence.
The first line output "Alice" (without quotes) if Alice wins and "Bob" (without quotes) otherwise. It is obvious that there is no draw.
5 1 2 3 4 5
Alice
2 2 4
Bob
$$$Hile$$$ wants to play a game with you. First, you can select a number $$$x$$$ in the range of $$$[0, r]$$$.
Then $$$Hile$$$ will perform $$$n$$$ operations on the number $$$x$$$ you select, each of which is of one of the following three types:
Assume that $$$y$$$ is obtained by $$$x$$$ after $$$n$$$ operations. $$$Hile$$$ will ask you $$$q$$$ questions. For each question, the operations are fixed, and he will give you a number $$$r$$$ — the range. You should tell her which $$$x$$$ $$$(0 \le x \le r)$$$ you choose initially to maximize the final $$$y$$$.
The first line of the input contains two integers $$$n, q$$$ $$$(1\le n\le 2\times 10^5, 1\le q\le 2 \times 10^5)$$$ — The number of operations and the number of questions.
The next $$$n$$$ lines each line contains two integers $$$t, a$$$ $$$(1 \le t \le 3, 0 \le a \lt 2^{30})$$$ — the operation type and the number.
The next $$$q$$$ lines each line contains one integer $$$r$$$ $$$(1 \le r \lt 2^{30})$$$ — The number $$$Hile$$$ gives you.
Output $$$q$$$ lines — for each $$$r$$$, you should output which $$$x$$$ $$$(0 \le x \le r)$$$ you choose initially that $$$y$$$ is maximize possible.
If there are multiple answers, print any of them.
3 5 1 2 2 1 3 4 1 2 3 4 5
0 2 3 3 2
In the test case:
If choose $$$x = 0$$$, $$$y = ((0\ \&\ 2)\ |\ 1) \oplus 4 = 5$$$.
If choose $$$x = 1$$$, $$$y = ((1\ \&\ 2)\ |\ 1) \oplus 4 = 5$$$.
If choose $$$x = 2$$$, $$$y = ((2\ \&\ 2)\ |\ 1) \oplus 4 = 7$$$.
If choose $$$x = 3$$$, $$$y = ((3\ \&\ 2)\ |\ 1) \oplus 4 = 7$$$.
If choose $$$x = 4$$$, $$$y = ((4\ \&\ 2)\ |\ 1) \oplus 4 = 5$$$.
If choose $$$x = 5$$$, $$$y = ((5\ \&\ 2)\ |\ 1) \oplus 4 = 5$$$.
When $$$r = 1$$$, you can choose $$$x = 0$$$ or $$$x = 1$$$.
When $$$r = 2$$$, you can choose $$$x = 2$$$.
When $$$r \ge 3$$$, you can choose $$$x = 2$$$ or $$$x = 3$$$.
《艾尔登法环》 众所周知,《老头环》刚刚获得了 2022TGA年度最佳游戏。
$$$XPL$$$ 知道你很喜欢玩老头环,他想跟你一起玩老头环。但是粗心的 $$$XPL$$$ 忘记了添加你为游戏好友,所以他决定约你线下玩老头环。
$$$XPL$$$ 给你找来了 $$$2n$$$ 个老头围成了两个大小都为 $$$n$$$ 的环,并将他们从 $$$1$$$ 到 $$$2n$$$ 进行编号,其中编号为 $$$1$$$ 到 $$$n$$$ 的老头按顺序围成环$$$_1$$$,编号为 $$$n+1$$$ 到 $$$2n$$$ 的老头按顺序围成环$$$_2$$$,并且定义初始位置 $$$i\ (1\le i\le 2n)$$$ 是编号为 $$$i$$$ 的老头初始所站的位置。
现在让两个环同时从整数 $$$1$$$ 开始报数,环$$$_1$$$ 从 $$$1$$$ 号老头开始,环$$$_2$$$ 从 $$$n+1$$$ 号老头开始,环$$$_1$$$环$$$_2$$$ 并行地按照初始位置顺序循环地往后报,循环即初始位置 $$$n$$$ 往后是初始位置 $$$1$$$,初始位置 $$$2n$$$ 往后是初始位置 $$$n+1$$$。
每当报出的整数是 $$$m$$$ 的倍数时,两个环中报出这个数的老头就会交换位置,然后按顺序继续报数。
不知不觉已经报到了数字 $$$k$$$,老头环太过于好玩以致于 $$$XPL$$$ 已经忘记了每个 初始位置 现在站着的是哪个老头,于是向你寻求帮助,你能告诉他答案吗?
建议参照样例解释方便理解。
第一行输入3个整数 $$$n\ (1\le n\le 1000)$$$ — 共 $$$2n$$$ 个老头,$$$m\ (1\le m\le 1000)$$$ — 每次报到 $$$m$$$ 的倍数时交换,$$$k\ (1\le k\le 10^6)$$$ — 最后报到的数字。
第一行输出 $$$2n$$$ 个整数,第 $$$i$$$ 个数表示初始位置 $$$i$$$ 最后站着的老头的编号。
2 2 3
1 4 3 2
4 3 6
1 6 7 4 5 2 3 8
样例1解释如下: