相关分类: Java技术 C/C++ VB delphi
  • T7316 yyy的最大公约数(者)

    题目背景 全场基本暴力 题目描述 输入输出格式 输入格式: 如图 输出格式: 如图 输入输出样例 输入样例#1: 如图 输出样例#1: 如图 说明 如图 这题用到了容斥原理和线性筛的一些东西, 表示没怎么看懂、。。。 1 #includeiostream 2 #includecstdio 3 #includecstrin...

    2018-06-17 22:12:45

  • P2915 [USACO08NOV]奶牛混合起来Mixed Up Cows

    题目描述 Each of Farmer John's N (4 = N = 16) cows has a unique serial number S_i (1 = S_i = 25,000). The cows are so proud of it that each one now wears her number in a gangsta manner engraved in large letters on a gold plate hung around her ample...

    2018-06-17 22:12:42

  • 单调队列初步——转载自“he-honghua的专栏”

    http://blog.csdn.net/justmeh/article/details/5844650...

    2018-06-17 22:12:34

  • “玲珑杯”ACM比赛 Round #18--最后你还是AK了(搜索+

    题目链接 DESCRIPTION INPUT OUTPUT SAMPLE INPUT 1 4 2 1 2 5 2 3 5 3 4 5 5 5 SAMPLE OUTPUT 35 HINT 对于样例,我们将1和4匹配,2和3匹配,然后对2和3之间的边使用膜法,对3和4之间的边使用魔法 若出现爆栈问题,改栈方法请参考1093题目代码 1093地址:http://www.ifrog...

    2018-06-17 22:12:35

  • Brackets

    Brackets Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8085 Accepted: 4299 Description We give the following inductive definition of a regular brackets sequence: the empty sequence is a regular brackets sequence, if s is a regular brack...

    2018-06-17 22:12:29

  • 欧拉筛素数

    欧拉筛素数: 时间复杂度:O(n) 主要思路:对于每一个合数,让他的最大的约数把他筛去 1 #includeiostream 2 #includecstdio 3 #includecstring 4 #includecmath 5 #define lli long long int 6 using namespace std; 7 const int MAXN= 10000001 ; 8 void read( int n...

    2018-06-17 22:12:33

  • Common Subsequence

    Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53247 Accepted: 22084 Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = x1, x2, ..., xm another sequence Z...

    2018-06-17 22:12:31

  • 欧拉函数线性筛法

    1 #includeiostream 2 #includecstdio 3 #includecstring 4 #includecmath 5 #define lli long long int 6 using namespace std; 7 const int MAXN= 10000001 ; 8 void read( int n) 9 { 10 char c= ' + ' ; int x= 0 ; bool flag= 0 ; 11 while (c ' 0 ' ||c ' 9 ' ){...

    2018-06-17 22:12:28

  • 04:最长公共子上升序列

    总时间限制: 10000ms 内存限制: 65536kB 描述 给定两个整数序列,写一个程序求它们的最长上升公共子序列。 当以下条件满足的时候,我们将长度为N的序列S 1 , S 2 , . . . , S N 称为长度为M的序列A 1 , A 2 , . . . , A M 的上升子序列: 存在 1 = i 1 i 2 . . . i N =...

    2018-06-17 22:12:26

  • 最长公共子序列(稀疏序列)nlogn解法

    首先这种做法只能针对稀疏序列, 比如这种情况: abc abacabc 。 会输出5 ,,,,就比较尴尬, 1 #includeiostream 2 #includecstdio 3 #includecstring 4 #includecmath 5 #includealgorithm 6 #define lli long long int 7 using namespace std; 8 const int MAXN=...

    2018-06-17 22:12:21

2