HDU - 3336 Count the string dp+kmp

题目链接:点击查看 It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example: s: "abab" The prefixes are: "a", "ab", "aba", "a
分类: 其他 发布时间: 02-27 23:29 阅读次数: 0

后缀数组 Distinct Substrings SPOJ - DISUBSTR /New Distinct Substrings SPOJ - SUBST1

后缀数组-处理字符串的有力工具 : 点击查看 后缀数组模板及代码详解:点击查看 Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 Output For each test case outpu
分类: 其他 发布时间: 02-27 23:28 阅读次数: 0

EOJ Monthly 2019.2 (based on February Selection)

题目链接:点击查看 A. 回收卫星 单测试点时限: 1.0 秒 内存限制: 256 MB “这个世上没有无用的齿轮,也只有齿轮本身能决定自己的用途。” 就像太空中的卫星,虽然不计其数,但都各司其职。 但没有一个东西是能够永远无损的。为了便于回收及修理,卫星在故障后会生成一个球形的星场,与之配对的感应器能判断其是否在星场内。 QQ 小方现在要负责卫星的回收工作,他负责使用这些感应器锁定卫星的位置。QQ 小方有卫星基本的运动信息,因此每次工作时,他都能保证自己与卫星保持相对静止,以及自己在星场内。
分类: 其他 发布时间: 02-27 23:28 阅读次数: 0

CodeForces1131 D. Gourmet choice 并查集+拓扑排序

题目连接:点击查看 Mr. Apple, a gourmet, works as editor-in-chief of a gastronomic periodical. He travels around the world, tasting new delights of famous chefs from the most fashionable restaurants. Mr. Apple has his own signature method of review — in each
分类: 其他 发布时间: 02-27 23:28 阅读次数: 0

CodeForces1131 F. Asya And Kittens 并查集

题目连接:点击查看 output standard output Asya loves animals very much. Recently, she purchased n kittens, enumerated them from 1 and n and then put them into the cage. The cage consists of one row of n cells, enumerated with integers from 1 to n from left t
分类: 其他 发布时间: 02-27 23:28 阅读次数: 0

CodeForces - 1118F1 Tree Cutting (Easy Version) 树形dp

You are given an undirected tree of nn vertices. Some vertices are colored blue, some are colored red and some are uncolored. It is guaranteed that the tree contains at least one red vertex and at least one blue vertex. You choose an edge and remove
分类: 其他 发布时间: 02-27 23:27 阅读次数: 0

CodeForces - 1118E Yet Another Ball Problem 构造

The king of Berland organizes a ball! nn pair are invited to the ball, they are numbered from 11 to nn. Each pair consists of one man and one woman. Each dancer (either man or woman) has a monochrome costume. The color of each costume is represented
分类: 其他 发布时间: 02-27 23:27 阅读次数: 0

Coffee and Coursework CodeForces - 1118D2 二分+贪心

The only difference between easy and hard versions is the constraints. Polycarp has to write a coursework. The coursework consists of mm pages. Polycarp also has nn cups of coffee. The coffee in the ii-th cup Polycarp has aiaicaffeine in it. Polycar
分类: 其他 发布时间: 02-27 23:27 阅读次数: 0

CodeForces - 1118C Palindromic Matrix 构造 优先队列

Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed. For example, the following matrices are palindromic: Th
分类: 其他 发布时间: 02-27 23:27 阅读次数: 0

深入理解计算机系统-第三章-程序的机器级表示-3.4

上一篇博客我们讲了在汇编语言中,如下的几个处理器状态是可见的: 一、程序计数器(在 IA32 中通常称为 PC,用 %eip 表示):指示将要执行的下一条指令在存储器中的地址。 二、整数寄存器文件:包含8个命名的位置,可以存储一些地址或者整数的数据。有的用来记录某些重要的程序状态,有的则用来保存临时数据。 三、条件码寄存器:保存最近执行的算数或逻辑指令的状态信息,它们用来实现控制或数据流中的条件变化,比如用来实现 if 和 while 语句。 四、浮点寄存器:存储浮点数。 这里我们要讲的就是第
分类: 其他 发布时间: 02-27 23:26 阅读次数: 0

CMU-CSAPP-深入理解计算机系统-P1-courseoverview

首先让我们看一个实例 原因是数据是如何在内存中布局。C不会进行边界检查,容易崩溃 这两种程序功能是一样的 但是他们的时间完全不一样
分类: 其他 发布时间: 02-27 23:26 阅读次数: 0

c陷阱与缺陷学习笔记-第一章-词法陷阱

对于c语言来说,程序中的单个字符孤立来看并没有什么意义。 符号(token)值得是程序的一个基本组成单元,其作用相当于一个句子中的单词。从某在意义上来说,一个单词无论出现在那个句子,它代表的意思都是一样的,是一个表义的基本单元。与此类似,符号就是程序中的一个基本信息单元。而组成的字符序列就不同,同一组字符序列在某个上下文环境中属于同一个符号,而在另一个上下文黄金中可能属于完全不用的另一个符号。 例如:p->s="->",如上面的字符‘-’和字符’>'组成的字符序列,在不同的上下文环境中,一个代
分类: 其他 发布时间: 02-27 23:26 阅读次数: 0

c语言100题-第一题

总结 不知道用&& 而且没有解决思路
分类: 其他 发布时间: 02-27 23:25 阅读次数: 0

C++-P19-访问控制(类的访问权限)(有作业)

如果是public的话,所有人都有权限更改 如果改成protected的话,就不能修改
分类: 其他 发布时间: 02-27 23:25 阅读次数: 0

C++-P20-覆盖方法和重载方法

这里的public说明如果基类是什么访问权限,继承下来就是什么访问权限 就相当于猪和人都会吃,但是吃法不一样,从共性里面寻找特性 给一个参数 现在报错 都是eat,但是一个有参数 出错了,因为有参数的把没有参数的覆盖掉了
分类: 其他 发布时间: 02-27 23:25 阅读次数: 0

C++-P21-友元关系(有作业)

分类: 其他 发布时间: 02-27 23:25 阅读次数: 0

深入理解计算机系统-第三章-程序的机器级表示-3.5

3.5 算术和逻辑操作 下图列出了一些双字整数操作,分为四类。二元操作有两个操作数,而一元操作只有一个操作数。描述这些操作数的符号与3.4节中使用的符号完全相同,除了leal以外,每条指令都有对应的对字和对字节操作的指令。把后缀l换成w就是对字的操作,换成b就是对字节的操作。例如,addl对应有addw和addb。 这里面比较特别的指令就是leal(取地址指令),其余的指令都是比较常规的算术和逻辑运算,相比之下还比较好理解,因此LZ这里重点介绍leal指令,对于其余的指令LZ不会一一介绍,接下
分类: 其他 发布时间: 02-27 23:24 阅读次数: 0

C++-P22-静态属性和静态方法

c++一般避免申明全局变量 让其他类里面的成员只能读不能写
分类: 其他 发布时间: 02-27 23:24 阅读次数: 0

linux鸟哥-第7章-linux的文件与目录管理

# 7.1.1相对路径与绝对路径 绝对路径:路径的写法一i的那个是由根目录/写起,例如/usr/share/doc这个目录 相对路径:路径的写法不是由/写起 7.1.2 目录的相关操作 下面是一些比较特殊的目录 . 代表此层目录 .. 代表上一层目录 - 代表上一个工作目录 ~ 代表目前用户身份所在的主文件夹 ~account 代表account这个用户的主文件夹 下面就是我们常见的处理目录的命令吧 cd:切换目录 pwd:显示当前目录 mkdir:新建一个新的
分类: 其他 发布时间: 02-27 23:24 阅读次数: 0

袁春风-计算机系统基础-P1-C语言程序举例

分类: 其他 发布时间: 02-27 23:24 阅读次数: 0