相关分类: Java技术 C/C++ VB delphi
  • 【poj3107】 Godfather

    Description Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders. Unfortunately, the structure of Chicago mafia is rather complicate...

    2018-06-17 21:54:10

  • Milking Grid POJ - 2185 || 最小覆盖子串

    Milking Grid POJ - 2185 最小覆盖子串: 最小覆盖子串(串尾多一小段时,用前缀覆盖)长度为n-next[n](n-pre[n]),n为串长。 当n%(n-next[n])==0时,有最小循环节(就是最小覆盖子串)。 快照: 我对KMP的一些理解(lyp点拨的):pre[i](或next[i])的实质是串str[...

    2018-06-17 21:54:04

  • C++#pragma pack指令

    微软官方文档说#pragma pack 指令的作用是为结构、联合和类成员指定 pack 对齐。的主要作用就是改变编译器的内存对齐方式,这个指令在网络报文的处理中有着重要的作用,#pragma pack(n)是他最基本的用法,其作用是改变编译器的对齐方式, 不使用这条指令的情况下,编译...

    2018-06-17 21:53:55

  • Arthur and Table CodeForces - 557C

    Arthur and Table CodeForces - 557C 首先,按长度排序。 长度为p的桌腿有a[p]个。 要使得长度为p的桌腿为最长,那么要按照代价从小到大砍掉sum{长度不到p的腿的数量}-a[p]+1条腿。还需要将所有长于p的桌腿砍光。枚举p即可。 要点(看了题解才明白):可以通过精力最高...

    2018-06-17 21:53:39

  • const

    const引用可以绑定非const对象、字面值、一般表达式。 const引用绑定另外一种类型时,实际绑定了一个临时量对象。编译器由另外一种类型生成一个临时的const引用类型常量,让const引用绑定这个临时量。 Tip:指向常量的指针或引用”自以为是“,觉得自己指向了常量,自...

    2018-06-17 21:53:52

  • Bubble Sort Graph CodeForces - 340D || 最长不下降/

    Bubble Sort Graph CodeForces - 340D 题意: 给出一个n个数的数列,建一个只有n个结点没有边的无向图,对数列进行冒泡排序,每交换一对位置在(i,j)的数在点i和点j间连一条边。排序完后,求得到图的最大独立集。 解释: 最初想到的是图的最大独立集,认为不能解,于是...

    2018-06-17 21:53:38

  • 【poj 2431】Expedition

    Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and puncture the truck's fuel tank. The truck now leaks one unit of fuel eve...

    2018-06-17 21:53:41

  • P3507 [POI2010]GRA-The Minima Game

    题目描述 Alice and Bob learned the minima game, which they like very much, recently. The rules of the game are as follows. A certain number of cards lies on a table, each inscribed with a positive integer. The players make alternate moves, Alice mak...

    2018-06-17 21:53:35

  • typedef

    用途一: 定义一种类型的别名,而不只是简单的宏替换。可以用作同时声明指针型的多个对象。比如: char* pa, pb;// 这多数不符合我们的意图,它只声明了一个指向字符变量的指针, // 和一个字符变量; 以下则可行: typedef char* PCHAR; PCHAR pa, pb; 这种用法很有用...

    2018-06-17 21:53:29

  • Music in Car CodeForces - 746F

    Music in Car CodeForces - 746F 题意很难懂啊... 题意:http://blog.csdn.net/a838502647/article/details/74831793 题意是说找出一个连续区间,使得区间内所有a值之和最大。对区间的要求:区间内可以选出最多k个b值(题目用的是t,但是我换成了b)减去一半(如果b是...

    2018-06-17 21:53:26

2