Deceleration官方中文
题目描述
官方中文There is a car driving on a number line. You need to handle the following two types of operations a total of $q$ times: At the $x$-th second, add a deceleration plan. After the car has traveled for $x$ seconds, its speed will be halved. Note that there can be multiple deceleration plans at the same second. If there are $n$ deceleration plans in one second, its speed will be reduced to $\frac{1}{2^n}$ of its original speed. Assuming the car starts from position $0$ at time $0$ with a speed of $1$ and moves in the positive direction, calculate the time it takes to reach position $x$. For all operations of the second type, output the result modulo $1,000,000,007$.官方中文
输入格式
官方中文The first line contains a positive integer $q$ ($1 \leq q \leq 5 \times 10^5$), representing the number of operations.
The next $q$ lines each contain two integers $o$ and $x$ ($o \in \{1,2\}$, $1 \leq x \leq 10^9$), representing the type of operation and its parameter.官方中文
输出格式
官方中文For all operations of the second type, output a single integer on a new line, representing the result modulo $1,000,000,007$.官方中文
样例
11
2 1
2 5
2 114514
1 5
2 4
2 6
1 3
2 4
2 5
1 114514
2 19198101
5
114514
4
7
5
9
15243944题面与样例版权归 牛客竞赛 及出题人所有;中文翻译由 AI 生成(官方原文),如有出入请以原文为准。