Read more -->Ignatius is so lucky that he met a Martian yesterday. But he didn’t know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want to translate the history book into English. Can you help him?
这是 百度
**<a href="https://fireworks99.github.io/2019/04/10/Gitment-%E8%AF%84%E8%AE%BA/" style="color:violet;">如何参与Gitment评论</a>**
**<a href="网址" style="color:violet;">题目链接</a>**
https://fireworks99.github.io/
Read more -->Read more -->My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces ……
给定一个长度为n的数列a,要求支持操作add(L,R,k)表示对a[L]~a[R]的每个数都加上k。并求修改后的序列a。
设原数组为a[i]a[i], 设数组d[i]=a[i]−a[i−1](a[0]=0),则 a[i]=∑ij=1d[j]
更新操作update(s, t, d)把区间A[s]…A[t]都增加d,我们引入一个数组delta[i],表示
A[i]…A[n]的共同增量,n是数组的大小。那么update操作可以转化为:
1)令delta[s] = delta[s] + d,表示将A[s]…A[n]同时增加d,但这样A[t+1]…A[n]就多加了d
2)再令delta[t+1] = delta[t+1] - d,表示将A[t+1]…A[n]同时减d
我们考虑用差分的做法。这里 需要一个辅助数组c,c用来记录某一个位置上的总改变量。c[i]表示的是i~n这些元素都加上c[i]这个数。我们对[L,R]区间进行加值操作,在c[L]处加一个k,在c[R+1]处就减去一个k。最后求序列的每个位置变成了多少,只需要求一下c数组的前缀和,然后和原数组按位相加就好。
Read more -->w = (d + 1 + 2 * m + 3 * (m + 1) / 5 + y + (y >> 2) - y / 100 + y / 400) % 7;
Read more -->d -> day m -> month y -> year
w == 0 ? 7 : w ;
Read more -->大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>0,N>0,M>0) 。聪明的ACMER你们说他们能平分吗?如果能请输出倒可乐的最少的次数,如果不能输出”NO”。
Read more -->In a speech contest, when a contestant finishes his speech, the judges will then grade his performance. The staff remove the highest grade and the lowest grade and compute the average of the rest as the contestant’s final grade. This is an easy problem because usually there are only several judges.