
dp
囿于昼夜one
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #652 (Div. 2) F BareLee
#include <iostream> #include <cstring> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <vector> #include <map> using namespace std; #define inf 0x7fffffff #define ll long l..原创 2020-06-30 23:16:01 · 6510 阅读 · 0 评论 -
最大连续子序列和
下面引入一个编程题理解最大连续子序列和的概念 有一个数组,如1, -5, 8, 3, -4, 15, -8,查找其中连续和最大的相邻串的值。在本例中,最大值为8 + 3 + -4 + 15 = 22. 朴素算法的复杂度为O(n^2),另一种算法如下: 首先假设我们已经找到了最大连续和子串在数组中的起始位置(i)和结束位置(j),其中i <= j,即最大和maxSum = a[i] + a...原创 2020-01-11 21:38:09 · 381 阅读 · 0 评论 -
2018 宁夏邀请赛 F Moving On
** 2018 宁夏邀请赛 F Moving On(floyd算法变形) ** Description Firdaws and Fatinah are living in a country with nn cities, numbered from 11 to nn.Each city has a risk of kidnapping or robbery. Firdaws’s home loc...原创 2019-08-31 12:17:45 · 1304 阅读 · 0 评论 -
2019牛客暑期多校训练营第一场 E题 ABBA
** ABBA ** 链接:https://ac.nowcoder.com/acm/contest/881/E?tdsourcetag=s_pcqq_aiomsg 来源:牛客网 题目描述 Bobo has a string of length 2(n + m) which consists of characters A and B. The string also has a fascinati...原创 2019-08-29 16:43:16 · 267 阅读 · 0 评论 -
2019牛客暑期多校训练营(第五场) G subsequence 1(DP+组合数学)
题目描述 You are given two strings s and t composed by digits (characters ‘0’ ∼\sim∼ ‘9’). The length of s is n and the length of t is m. The first character of both s and t aren’t ‘0’. Please calculate t...原创 2019-08-30 21:11:14 · 201 阅读 · 0 评论 -
2019牛客多校四 K number(dp或前缀和)
转载至:https://www.cnblogs.com/rookie-acmer/p/11258415.html number 题目描述 300iq loves numbers who are multiple of 300. One day he got a string consisted of numbers. He wants to know how many substrings in ...转载 2019-08-31 23:29:18 · 265 阅读 · 0 评论 -
2018-2019 ACM-ICPC, Asia Nakhon Pathom Regional Contest E How Many Groups
How Many Groups You are given an array of n integers. Define a binary relation ~ on the elements of this array so that x ~ y if and only if |x – y| is less than or equal to 2. Let ~* be the transitive...转载 2019-09-03 22:01:26 · 317 阅读 · 0 评论