高橋君とホテル / Tak and Hotels】的更多相关文章

高橋君とホテル / Tak and Hotels Time limit : 3sec / Stack limit : 256MB / Memory limit : 256MB Score : 700 points Problem Statement N hotels are located on a straight line. The coordinate of the i-th hotel (1≤i≤N) is xi. Tak the traveler has the following t…
Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement There is a hotel with the following accommodation fee: X yen (the currency of Japan) per night, for the first K nights Y yen per night, for the (K+1)-th and subsequent nigh…
高橋君とカード / Tak and Cards Time limit : 2sec / Stack limit : 256MB / Memory limit : 256MB Score : 300 points Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selecting one or more cards from these N cards, so t…
Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A. In how many ways can he make h…
题目链接:http://abc044.contest.atcoder.jp/tasks/arc060_a Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selecting one or more cards from these N card…
AT987 高橋君 给出 \(n,\ k\) ,求 \(\displaystyle\sum_{i=0}^kC_n^k\) , \(T\) 次询问 \(T\leq10^5,\ 0\leq k\leq n\leq10^5\) 莫队 莫队,考虑如何将 \(\displaystyle\sum_{i=0}^kC_n^i\) 转移到 \(\displaystyle\sum_{i=0}^{k+1}C_n^i,\ \displaystyle\sum_{i=0}^{k-1}C_n^i,\ \displaystyl…
题目 成爷爷一眼秒,\(tql!!!\) 多组询问,求 \[\sum_{i=0}^kC_{n}^i \] 发现\(k<=n\)啊,于是我们可以把一组询问抽象成一个区间\([k,n]\) 左指针的移动非常好解决,就是加一下\(C_n^k\)减一下\(C_n^k\)就好了 考虑一下右指针的移动,就是\(n+1\)或者\(n-1\) 如果\(n+1\),就是从\(\sum_{i=0}^kC_n^i\)变成了\(\sum_{i=0}^kC_{n+1}^i\) 我们利用组合数的小学生求法,拆开我们的柿子…
http://arc063.contest.atcoder.jp/tasks/arc063_b 因为每次都是选取最大值,那么用dp[i]表示第i个数结尾能得到最大是多少. 其实就是用a[i]去减去左边最小的那个数字. 然后就是统计有多少个一样的最大值了.. hack点 T是没用的,我被坑了,以为最多只能T / 2次,那么答案是min(T / 2, cnt_max) 但是不是.就算你T / 2只是1,那么,我也可以走不同的道路来取得max,所以要改变的cnt_max还是要改变. 和T无关.. #i…
6463: Tak and Hotels II 时间限制: 1 Sec  内存限制: 128 MB 题目描述 N hotels are located on a straight line. The coordinate of the i-th hotel (1≤i≤N) is xi.Tak the traveler has the following two personal principles:He never travels a distance of more than L in a…
传送门 一道有意思的题. 一开始想错了,以为一直lowerlowerlower_boundboundbound就可以解决询问,结果交上去TLE了之后才发现时间复杂度是错的. 但是贪心思想一定是对的,每次向前尽量推进一定可以得到最优解. 于是我想起了一道叫做弹飞绵羊的题,感觉这道题可以类比. 码了一会一直WA感觉不太对,发现有一个细节写错了233. A了之后在csdn上翻了翻题解. 发现都是倍增优化%%%,我被自己的低智商给蠢哭了,是啊连修改操作都没有分块很low啊. 不过还是讲讲如何分块吧. 对…