- 博客(89)
- 资源 (1)
- 收藏
- 关注
原创 Mayor's posters(线段树 + 离散化)
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city coun
2014-08-14 15:50:50
1258
1
原创 Crane(线段树)
DescriptionACM has bought a new crane (crane -- jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning
2014-08-14 15:17:42
1163
原创 Cipher
DescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on secret keys. They chose the sec
2014-08-09 14:06:26
837
转载 中国剩余定理模板(互质版和非互质版)
互质版:#include #include #include using namespace std; typedef __int64 int64; int64 a[15],b[15]; int64 Extend_Euclid(int64 a, int64 b, int64&x, int64& y) { if(b==0) {
2014-08-08 20:29:18
919
原创 字典树模板
定义一颗字典树:struct Trie{ int n; // n可以存储相关有用信息,视情况而定 Trie *next[maxn]; //maxn视字典树中有多少种元素而定}定义字典树的根并初始化:Trie *root;void init(){ root = (Trie *)malloc(sizeof(Trie)); root ->
2014-08-08 15:42:15
783
原创 Word Puzzles(字典树)
DescriptionWord puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using table covers with word puzzles printed on them, possi
2014-08-08 15:00:09
2269
原创 Phone List(字典树 or 排序)
DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 911
2014-08-08 11:23:09
883
原创 Matrix Power Series(乘法矩阵)
DescriptionGiven a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.InputThe input contains exactly one test case. The first line of input con
2014-08-06 19:37:35
839
原创 Prime Distance(二次筛素数)
DescriptionThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the qu
2014-08-06 17:16:10
1580
转载 博弈的三个巨人 巴什博奕 威佐夫博奕 尼姆博奕
博客背景:在最早接触博弈的是培训课和学长来博弈,是巴什博弈,呵呵,感觉挺有趣的,以后就找个朋友耍他或者她,嘿嘿,AC之余还可以把妹,何乐而不为呢?凭什么咱们就得一直苦逼呢?嘿嘿~~闲话休提,进入正题 博客正容:【一】(先来苦涩的理论)(一)巴什博奕(Bash Game):只有一堆n 个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m 个。
2014-08-01 15:21:19
970
转载 并查集(Union-Find)算法介绍
本文主要介绍解决动态连通性一类问题的一种算法,使用到了一种叫做并查集的数据结构,称为Union-Find。更多的信息可以参考Algorithms 一书的Section 1.5,实际上本文也就是基于它的一篇读后感吧。原文中更多的是给出一些结论,我尝试给出一些思路上的过程,即为什么要使用这个方法,而不是别的什么方法。我觉得这个可能更加有意义一些,相比于记下一些结论。
2014-08-01 10:54:25
557
原创 Exponentiation(高精度)
DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many
2014-07-31 15:09:35
760
原创 How many Fibs?(高精度)
DescriptionRecall the definition of the Fibonacci numbers: f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calculate how many Fibonacci numbers are in the range
2014-07-31 14:42:38
912
曾棕根.ACM程序设计.pdf
2014-07-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人