Alice's hair is growing by leaps and bounds. Maybe the cause of it is the excess of vitamins, or maybe it is some black magic... To prevent this, Alice decided to go to the hairdresser. She wants for her hair length to be at most ll centimeters after…
传送门 题意: 给出你序列 a,在序列 a 上执行两种操作: ① 0 :查询有多少连续的片段[L,...,R],满足 a[L,...,R] > l: ② 1 p d :将第 p 个数增加 d: 思路: int n,m,l; ll a[maxn]; int fa[maxn];///a[L,...,x] > l 的最小的L: /** _bit[0][x]:a[x] > l,_bit[0][x]=1,反之为0: _bit[1][x]:a[L,...,R] > l,_bit[L]=1,_b…
A. Metro Solved. 题意: 有两条铁轨,都是单向的,一条是从左往右,一条是从右往左,Bob要从第一条轨道的第一个位置出发,Alice的位置处于第s个位置,有火车会行驶在铁轨上,一共有n个站点,1表示火车会在该站点停下,0表示不会,求Bob能否到达地s个位置(到达任意一边即可) 思路: 如果第一条铁轨的第一个位置为0,或者第s个位置的两条铁轨都不停,那么答案显然是$"No"$ 再考虑第一条铁轨上所有为1的位置都可以到达 再考虑两条轨道是否有同一个站点都都会停下的,那么就可以…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5558 Problem Description Alice wants to send a classified message to Bob. She tries to encrypt the message with her original encryption method. The message is a string S, which consists of Nlowercase let…
Alice and Bob Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 147 Accepted Submission(s): 22 Problem Description As you know, Alice and Bob always play game together, and today they get a…
Alice and Bob Time Limit: 1000ms Memory limit: 65536K 题目描述 Alice and Bob like playing games very much.Today, they introduce a new game. There is a polynomial like this: (a0*x^(2^0)+1) * (a1 * x^(2^1)+1)*.......*(an-1 * x^(2^(n-1))+1). Then Alice as…