
前后缀
永夜莫明
菜是原罪
展开
-
CS Course
Little A has come to college and majored in Computer and Science. Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework. Here is the problem: You are giving n ...原创 2018-12-06 23:30:38 · 307 阅读 · 0 评论 -
Beautiful Substrings(预处理)(思维 + 后缀和)
You are given two strings a and b consisting of lowercase English letters. A beautiful substring is defined as a substring of any length of string b such that the first and last letters of it are the ...原创 2018-12-16 12:03:19 · 313 阅读 · 0 评论 -
Minimax (预处理)(枚举)
You are given a grid consisting of n rows each of which is dived into m columns. The rows are numbered from 1 to n from top to bottom, and the columns are numbered from 1 to m from left to right. Each...原创 2018-12-16 15:37:22 · 294 阅读 · 0 评论 -
K倍区间(前缀和+思维)
题目描述给定一个长度为N的数列,A1, A2, ... AN,如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。 你能求出数列中总共有多少个K倍区间吗? 输入第一行包含两个整数N和K。(1 <= N, K <= 100000) 以下N行每行包含一个整数Ai。(1 <=...原创 2019-02-24 14:42:22 · 435 阅读 · 0 评论 -
Nim (nim博弈+前缀异或和+思维)
Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. The game ends when one of the players is unable to remove object in his/her turn. This play...原创 2019-03-12 23:58:28 · 1364 阅读 · 0 评论 -
ZOJ-3950 How Many Nines(前缀和 预处理)
题目链接:https://cn.vjudge.net/problem/ZOJ-3950If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates betweenY1-M1-D1andY2-M2...原创 2019-04-05 10:19:10 · 195 阅读 · 0 评论 -
Subarray(思维+模拟+lazy标记+……)
https://ac.nowcoder.com/acm/contest/882/J当时开局ac率100%,然后就死磕这道题(主要是因为题目短,不想去读别的题),一发RE,一发MLE,然后放弃了……WJYTXDY当时的想法很朴素,就是对于每一个位置的前缀和,看在他左边比他小的前缀和的数量(很明显时间复杂度不行,k*1e9,当时抱着如果评测机跑的快的话,说不定……),因为有负数,所以加...原创 2019-07-23 21:21:55 · 184 阅读 · 0 评论