自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

passer__的博客

ACM——最美的痕迹就是回忆

  • 博客(26)
  • 收藏
  • 关注

原创 组合数打表模板

//组合数打表模板,适用于N<=3000//c[i][j]表示从i个中选j个的选法。long long C[N][N];void get_C(int maxn){ C[0][0] = 1; for(int i=1;i) { C[i][0] = 1; for(int j=1;j) C[i][j] = C[i-1

2017-08-30 19:04:53 415

原创 CodeForces - 185A ( Plant)

A. Planttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDwarfs have planted a very interesting plant, whic

2017-08-26 19:41:20 283

原创 CodeForces - 405B(Domino Effect)

B. Domino Effecttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Chris knows there's no fun in playin

2017-08-26 19:32:04 234

原创 CodeForces 789B (Masha and geometric depression)

B. Masha and geometric depressiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha really loves algebra

2017-08-23 10:03:38 5126

原创 ~背包专题~01背包初体验

最近一直集训学习背包,刚开始就01背包,小小01背包里面有好多道道,今天就讲解01背包的模板题和求第K次最优解这样的两种题型,以后会不断的更新,毕竟有背包九解,需要学习的东西还有很多。首先01背包题目的雏形是有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使价值总和最大。从这个题目中可以看出,01背包的特点就是:每种物

2017-08-18 16:38:54 434

原创 最长递增子序列-动态规划dp-(51nod 1134)(POJ 2533)

最长递增子序列粗解带来了两个比较经典的求解最长递增子序列的题目①点击打开链接 51nod 11341134最长递增子序列基准时间限制:1 秒 空间限制:131072 KB 分值:0难度:基础题给出长度为N的数组,找出这个数组的最长递增子序列。(递增子序列是指,子序列的元素是递增的)例如:5 1 6 8 2 4 5 10,最长递增子序列

2017-08-17 14:30:29 359

原创 2016中国大学生程序设计竞赛 - 网络选拔赛

此博客纪今天2016中国大学生程序设计竞赛 - 网络选拔赛 三道水题。HDU 5832(第一个)A water problemTime Limit: 5000/2500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2871

2017-08-13 19:36:31 1461

原创 2017"百度之星"程序设计大赛 - 初赛(A)

小C的倍数问题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 345    Accepted Submission(s): 187Problem Description根据小学数学的知识,我们知道一个正整数x

2017-08-12 21:04:51 232

原创 UVALive-7279 - Sheldon Numbers(暴力大法)

题目连接:7279题目大意是:给你一个数字,他可以变成由10组成的二进制的这样的串然后让你判断下能不能组成ABABAB*****AB或者ABABABABABA这样的形式;(A=1,B=0)第一种情况是:全部都是A没有B;第二种情况就是上边写的那两种,一个是以A结尾一个是以B结尾。数据量不大最多就63,三层63的循环无压力。这个地方用到了STL里面的set,不会的去百度下。

2017-08-09 15:29:24 357

原创 51Nod - 1625 夹克爷发红包(暴力+贪心)

1625夹克爷发红包基准时间限制:1 秒 空间限制:131072 KB 分值:20难度:3级算法题在公司年会上,做为互联网巨头51nod掌门人的夹克老爷当然不会放过任何发红包的机会。现场有n排m列观众,夹克老爷会为每一名观众送出普通现金红包,每个红包内金额随机。接下来,夹克老爷又送出最多k组高级红包,每组高级红包会同时

2017-08-07 15:24:44 825

原创 Sort 函数(cmp用法的介绍)

C++中有一个sort函数这个函数需要用到#include&lt;algorithm&gt;    using namespace std;原来觉得自己懂了cmp的用法,但是今天做题,因为cmp函数一直WA,所以又查了查关于cmp的用法。然后准备写下来自己的想法,避免以后在此忘记。格式为bool cmp(T ,x, T y){if(x&gt;y)return 1;...

2017-08-07 14:03:33 12650 3

原创 HDU1052 Tian Ji -- The Horse Racing(贪心)

Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30958    Accepted Submission(s): 9392Problem Description

2017-08-07 10:52:00 215

原创 51Nod 1449(砝码称重)

现在有好多种砝码,他们的重量是 w0,w1,w2,...w0,w1,w2,...  每种各一个。问用这些砝码能不能表示一个重量为m的东西。样例解释:可以将重物和3放到一个托盘中,9和1放到另外一个托盘中。Input单组测试数据。 第一行有两个整数w,m (2 ≤ w ≤ 10^9, 1 ≤ m ≤ 10^9)。Output如果能,输出YES,否则输出NO。Sample

2017-08-07 10:34:16 324

原创 度度熊与邪恶大魔王(2017"百度之星"程序设计大赛 - 资格赛)

度度熊与邪恶大魔王  Accepts: 1764  Submissions: 10691 Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 32768/32768 K (Java/Others)Problem Description度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗

2017-08-05 19:39:47 639 2

原创 POJ 2968 The Pilots Brothers' refrigerator(DFS)

The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26904 Accepted: 10375 Special JudgeDescriptionThe game “The Pilot

2017-08-05 10:46:13 305

原创 poJ 1753(dfs) Flip Game

Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46061 Accepted: 19735DescriptionFlip game is played on a rectangular 4x4 field with two-sided p

2017-08-05 10:38:15 75

原创 POJ 2352 Stars

StarsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 48138 Accepted: 20778DescriptionAstronomers often examine star maps where stars are represented by

2017-08-04 09:06:06 164

原创 HDu 1166 敌兵布阵(树状数组)

敌兵布阵Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 94813    Accepted Submission(s): 40010Problem DescriptionC国的死对头A国这段时间正在进行军事演

2017-08-04 09:01:25 187

原创 HDU 1556 Color the ball(树状数组)

Color the ballTime Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22191    Accepted Submission(s): 10749Problem DescriptionN个气球排成一排,

2017-08-04 08:55:08 205

原创 HDu 2686 Sort is (树状数组)

Sort itTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4744    Accepted Submission(s): 3301Problem DescriptionYou want to proces

2017-08-04 08:49:05 150

原创 树状数组小结(未完待续)

最近刚刚深入到了树状数组是什么,上年寒假学过,但是当时完全听不到,最近两天沉下心来,好好看了下,终于懂这个原理是什么,感觉并不是很难,而且很好用。这个图应该更好理解:d[1]=a[1];d[2]=a[1]+a[2];d[3]=a[3];d[4]=a[1]+a[2]+a[3]+a[4];依次类推,6管着5和6  8管着前8项,如果一个N (偶数)除以2还是

2017-08-04 08:41:31 224

原创 UPC 2017 Summer Training 1

A - Arcade Game Arcade mall is a new modern mall. It has a new hammer game called "Arcade Game". In this game you're presented with a number n which is hanged on a wall on top of a long vertical

2017-08-02 20:25:04 322

原创 UPC 2017 Summer Training 1

I - SalemSalem is known to be one of the best competitive programmers in the region. However, he always finds a hard time understanding the concept of the hamming distance. The hamming

2017-08-02 20:17:46 275

原创 UPC 2017 Summer Training 1

B - Unlucky Teacher Ali is a teacher in one of Kuwait universities. Last week he made a multi-choice test for his students. After the test, he marked some papers before collecting all papers and

2017-08-02 20:04:46 373

原创 HDU2062(Subset sequence)

Subset sequenceTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6325    Accepted Submission(s): 2975Problem DescriptionConsider t

2017-08-02 11:03:57 390

原创 HDu2059 龟兔赛跑 DP

龟兔赛跑Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19654    Accepted Submission(s): 7252Problem Description据说在很久很久以前,可怜的兔子经历了人生

2017-08-02 08:24:32 503

空空如也

空空如也

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

TA关注的人

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