- 2024-05-31C. Tea Tasting
题目链接:https://codeforces.com/problemset/problem/1795/Corhttps://www.luogu.com.cn/problem/CF1795C总思路:利用数组记录a[N],b[N]分别记录每杯茶的量,每个人喝的量,然后每个人喝的量进行前缀和,再二分查找,利用divx和mod来确定每个人喝的量:divx是喝了几整杯;mod是额外的
- 2023-12-19[Codeforces] CF1795C Tea Tasting
CF1795CTeaTasting题意有\(n\)个人和\(n\)杯茶,第\(i\)个人每次会喝\(b_i\)毫升的茶。第\(i\)杯茶有\(a_i\)毫升。总共会喝\(n\)轮茶,第\(j\)轮第\(i\)个人会尝试喝第\(i+1-j\)杯茶。喝的量为\(\min(a_{i+1-j},b_i)\)毫升,并且使\(a_{i+1-j}\)减少\(\mi
- 2023-10-23#结论#CF1776G Another Wine Tasting Event
题目给定一个长度为\(2n-1\)的字符串,问一组使得\(n\)个长度不小于\(n\)的区间中字母W的个数相等的字母W的个数分析首先结论就是\(\max_{i=1}^n\{cW[i\dotsi+n-1]\}\)一定是合法解以这组解为基准,左右端点如果向外扩展那么个数一定会更多或者不变,而此时由于当前字母
- 2023-03-04G. Another Wine Tasting Event
https://codeforces.com/contest/1776/problem/G题意:给定一个2*n-1序列问是否存在一个x使得有n个长度>=n的子串中含有'W'数量为x,且子串两两不同。n<=1e6题解:答案为长度
- 2023-02-20CF1795C Tea Tasting
有一排桌子,每个桌子上有\(a_i\)杯茶,现有\(m\)个人,第\(i\)个人在一轮喝茶中要喝\(b_i\)杯茶,如果桌子上不满\(b_i\)杯茶,那他将该桌子上的茶全部喝光,初始第\(i\)
- 2023-02-18C. Tea Tasting
https://codeforces.com/contest/1795/problem/C用二分+前缀和+差分卡过#include<iostream>#include<cstring>#include<algorithm>#include<string>#include<cm