自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

userluoxuan的专栏

One AC a Day,Keep Sadness Away!

  • 博客(89)
  • 资源 (1)
  • 收藏
  • 关注

原创 Balanced Lineup(RMQ)

解题思路:用RMQ求出各区间的最大最小值,

2014-08-16 20:19:18 674

转载 线段树模板

单点更新,区间求和:

2014-08-14 20:21:06 503

原创 Panda(线段树)

解题思路:用每个字符的下标记录

2014-08-14 16:19:59 719

原创 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 1212 2

原创 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 1105 1

原创 A Simple Problem with Integers(线段树)

解题思路:区间更新,区间求和的模板题。AC代码:

2014-08-14 15:15:35 483

原创 Coder(暴力)

解题思路:本来该题是应该用线段树来

2014-08-14 15:10:12 514

原创 Billboard(线段树)

解题思路:题目大意是

2014-08-11 17:22:34 448

原创 Minimum Inversion Number(线段树)

解题思路:用线段树求逆序对。只需要

2014-08-11 17:07:19 634 1

原创 I Hate It(线段树)

解题思路:线段树,点更新,求

2014-08-11 17:05:44 453

原创 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 790

原创 Goldbach's Conjecture(筛选法求素数)

解题思路:筛选法求素数模板题,

2014-08-08 20:34:02 522

转载 中国剩余定理模板(互质版和非互质版)

互质版:#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 889

原创 字典树模板

定义一颗字典树: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 751

原创 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 2183

原创 IMMEDIATE DECODABILITY(字典树)

解题思路:这题和之前的

2014-08-08 14:57:19 428

原创 Babelfish(字典树 or map)

解题思路:这题用字典树做可以,用map映射做也可以,当然字典树效率

2014-08-08 14:43:07 587

原创 Shortest Prefixes(字典树)

解题思路:和前面一道

2014-08-08 12:06:32 490

原创 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 850

原创 统计难题(字典树)

解题思路:直接

2014-08-08 11:20:53 506

原创 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 797

原创 A/B(乘法逆元)

解题思路:最水的乘法逆元题

2014-08-06 19:27:16 1285

原创 Wolf and Rabbit(最大公约数)

解题思路:题目大意是给几个洞,狼从第1个

2014-08-06 19:16:15 559

原创 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 1536

原创 青蛙的约会(扩展欧几里得)

解题思路:设走了s步,则

2014-08-06 17:13:10 491

原创 Georgia and Bob(尼姆博弈)

解题思路:对相邻棋子进行两两配对。比如有6个棋子,就配成

2014-08-01 21:20:20 458

原创 取(2堆)石子游戏(威佐夫博弈)

解题思路:这题是彻底

2014-08-01 17:23:12 580

原创 Public Sale(巴什博弈)

解题思路:巴什博弈

2014-08-01 17:19:48 480

原创 取石子游戏(威佐夫博弈)

解题思路:威佐夫

2014-08-01 17:18:16 643

原创 悼念512汶川大地震遇难同胞――选拔志愿者(巴什博弈)

解题思路:巴什博弈模板题。AC代码:

2014-08-01 17:13:35 541

原创 Being a Good Boy in Spring Festival(尼姆博弈)

做题思路:尼姆博弈模板题。AC代码:

2014-08-01 17:11:02 422

原创 取(m堆)石子游戏(尼姆博弈)

解题思路:基本的尼姆博弈类型题,还要输出第一次的方案,只需要

2014-08-01 16:59:01 524

转载 博弈的三个巨人 巴什博奕 威佐夫博奕 尼姆博奕

博客背景:在最早接触博弈的是培训课和学长来博弈,是巴什博弈,呵呵,感觉挺有趣的,以后就找个朋友耍他或者她,嘿嘿,AC之余还可以把妹,何乐而不为呢?凭什么咱们就得一直苦逼呢?嘿嘿~~闲话休提,进入正题  博客正容:【一】(先来苦涩的理论)(一)巴什博奕(Bash Game):只有一堆n 个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m 个。

2014-08-01 15:21:19 931

转载 并查集(Union-Find)算法介绍

本文主要介绍解决动态连通性一类问题的一种算法,使用到了一种叫做并查集的数据结构,称为Union-Find。更多的信息可以参考Algorithms 一书的Section 1.5,实际上本文也就是基于它的一篇读后感吧。原文中更多的是给出一些结论,我尝试给出一些思路上的过程,即为什么要使用这个方法,而不是别的什么方法。我觉得这个可能更加有意义一些,相比于记下一些结论。

2014-08-01 10:54:25 522

原创 Matches Game(尼姆博弈)

解题思路:尼姆博弈模板题。AC代码:

2014-07-31 23:47:07 475

原创 NUMBER BASE CONVERSION(进制转化)

解题思路:题目大意是给一个a进制的数,让你化作b进制,给的数会很大。

2014-07-31 23:25:50 1092

原创 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 698

原创 Just the Facts

解题思路:千万别看到阶层就以为是

2014-07-31 14:55:33 530

原创 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 884

原创 Integer Inquiry(高精度)

解题思路:就是一般的高精度加法题,唯一需要注意的是输入数据中有些会有前导0

2014-07-31 14:41:24 549

曾棕根.ACM程序设计.pdf

本书详细讲解了 ACM 国际大学生程序设计竞赛(ACM/ICPC)编程、调试方法,以及提高时间、 空间性能的策略,并充分利用了 C++泛型编程的高效率、规范化的特性,全部采用 C++泛型编程。 第 1 章讲解了 ACM 程序设计入门知识;第 2 章讲解了 C++泛型编程的容器、迭代器和常用算法; 第 3 章讲解了 ACM 程序设计的基本编程技巧;第 4 章讲解了 50 道原版 ACM 竞赛题的解题思路,并 配有 C++泛型编程参考答案和题目的中文翻译。 本书是一本专门针对 ACM 国际大学生程序设计竞赛而编写的入门教程,适合参加 ACM/ICPC 的 大学生和 C++编程爱好者学习,对 ACM/ICPC 竞赛教练也具有一定的指导作用。

2014-07-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除