题目传送门 A. Sequence with Digits an+1=an+minDigit(an)?maxDigit(an),已知a1,k,求ak。 当minDigit(an)=0时,an+1=an,对后续的答案不会产生影响了。 #include <bits/stdc++.h> using nam ...
分类:
其他好文 时间:
2020-05-18 23:02:42
阅读次数:
81
题目 Given a sequence of K integers { N?1?? , N?2?? , ..., N?K?? }. A continuous subsequence is defined to be { Ni?? , N?i+1?? , ..., N?j?? } where 1≤i≤ ...
分类:
其他好文 时间:
2020-05-18 22:37:14
阅读次数:
57
Least Cost Bracket Sequence(贪心) Describe This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if by inserti ...
分类:
其他好文 时间:
2020-05-18 18:19:11
阅读次数:
52
题目连接:https://www.luogu.com.cn/problem/CF3D —————————————————————————————————————————————————————————— 这一题是一个贪心的题目。 先把字符串中的问号都换成右括号,扫过去,如果左括号比右括号多(因为在任 ...
分类:
其他好文 时间:
2020-05-18 14:34:24
阅读次数:
54
"Least Cost Bracket Sequence" "CodeForces 3D " 题目描述 This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if ...
分类:
其他好文 时间:
2020-05-17 19:09:17
阅读次数:
56
分析 ~~看到括号匹配,先开个栈~~ 这题感觉还是不错的 首先需要知道代价最小的前提是括号序列 合法 ,所以不能单纯的贪心代价小的放法。 对于一个合法的序列来说,左右括号的数量一定相等,并且在当前位置,左括号的数量一定不小于右括号的数量,于是可以开一个栈来存左括号,遇到右括号就弹栈,栈空则不合法。 ...
分类:
其他好文 时间:
2020-05-17 19:07:46
阅读次数:
59
[TOC] https://codeforces.com/contest/1355 打一半和室友开黑去了哈哈哈哈哈哈反正不计分(不要学我) A. Sequence with Digits 这题我会证!首先对于百位来说,不可能从x跳到x+2,只能从x变成x+1或者不变(因为最大变化量为 $9\time ...
分类:
其他好文 时间:
2020-05-17 00:59:41
阅读次数:
90
Given a sequence with n elements, if the last element is also adjacent to the first element of the sequence, the sequence is called “circular sequence ...
分类:
其他好文 时间:
2020-05-16 10:45:50
阅读次数:
69
传送门:http://poj.org/problem?id=2778 题目大意:基因序列仅含AGCT四个英语字母,有m个病毒,长度不超过10,现在要制造一个长度为n的基因序列,问有多少种方案,使得我的基因序列不含有病毒子串。 样例输入: 4 3 AT AC AG AA 首先对于所有病毒先跑AC自动机 ...
分类:
其他好文 时间:
2020-05-14 01:39:03
阅读次数:
49
4.1 Python中的序列分类 4.1.1 容器序列 """ list tuple deque 可以放入任意类型的数据 """ 4.1.2 扁平序列 """ str bytes bytearray array.array 注意array与list的区别,array存放数据类型需一致,需指明存放什么 ...
分类:
编程语言 时间:
2020-05-13 23:09:39
阅读次数:
77