
Water(水题)
Chen_yuazzy
The best way to predict the future is to create it.
预测未来的最好办法是去创造它。
---Alan Kay
展开
-
【蓝桥杯】正则问题
题目描述:考虑一种简单的正则表达式: 只由 x ( ) | 组成的正则表达式。 小明想求出这个正则表达式能接受的最长字符串的长度。 例如 ((xx|xxx)x|(x|xx))xx 能接受的最长字符串是: xxxxxx,长度是6输入: ((xx|xxx)x|(x|xx))xx 程序应该输出: 6思路:遇到 '(' 就递归调用函数, 遇到 'a' 就将计数器x++原创 2017-06-23 22:08:51 · 3596 阅读 · 2 评论 -
【Codeforces 608B】Hamming Distance Sum(前缀和)
Hamming Distance SumDescription Genos needs your help. He was asked to solve the following programming problem by Saitama:The length of some string s is denoted |s|. The Hamming distance between two s原创 2017-08-10 22:29:39 · 838 阅读 · 0 评论 -
【HDU 5327】Olympiad(前缀和)
OlympiadDescription You are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digitals原创 2017-08-10 22:41:08 · 447 阅读 · 0 评论 -
【CSU 1529】Equator (前缀和,双端队列)
EquatorDescription Input Output Sample Input 3 3 1 2 3 8 4 5 -1 -1 1 -1 -1 5 2 -1 -1 Sample Output 6 14 0题意:输入数据:T数据组数 接下来T行,第一个数字n为个数。接下来有n个数(正/负都可能有)。求出这些数字(要保证相邻)最大的和。思路:用前缀和法预处理出数组每个数的前原创 2017-08-10 22:57:14 · 413 阅读 · 0 评论