自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(76)
  • 收藏
  • 关注

原创 关于奇偶检验为什么用归约异或

所以针对一个二进制数做归约异或的时候可以把0当作两个1,再把相邻的两个1当作0。显然当1的个数为奇数个时,最后替换完前面都是0末尾为1,归约异或结果为1。当1的个数为偶数个时,替换为全0,归约异或结果为0。综上所述,归约异或的结果跟数据中包含的1的个数有关,当1是偶数个时结果为0,1是奇数个时结果为1。所以想把我的想法简单记录一下。异或简而言之相同为0不同为1。4,数据的0和1调换位置不影响最终的结果。1,只有0和1相异或结果才会为1。2,一串0做归约异或结果为0。3,两个1做异或结果为0。

2022-09-07 14:24:54 951 2

原创 LightOJ 1294 - Positive Negative Sign

1294 - Positive Negative SignDescriptionGiven two integers:nandmandnis divisible by2m, you have to write down the firstnnatural numbers in the following form. At first take

2016-08-23 20:14:34 402

原创 LightOJ 1043 - Triangle Partitioning

1043 - Triangle PartitioningPDF (English)StatisticsForumTime Limit: 0.5 second(s)Memory Limit: 32 MBSee the picture below.You are given AB, 

2016-08-23 20:13:01 353

原创 LightOJ 1008 Fibsieve`s Fantabulous Birthday

DescriptionFibsieve had a fantabulous (yes, it's an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts th

2016-08-23 20:08:18 362

原创 CodeForces 597A Divisibility

Divisibilitytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFind the number of k-divisible numbers on the s

2016-08-23 20:02:52 320

原创 CodeForces 366A Dima and Guards

Dima and GuardsTime Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 366ADescriptionNothing has changed since the last

2016-08-22 20:55:43 470

原创 CodeForces 658A Bear and Reverse Radewoosh

Bear and Reverse RadewooshTime Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 658ADescriptionLimak and Radewoosh are

2016-08-22 20:52:22 304

原创 CodeForces 554B Ohana Cleans Up

Ohana Cleans UpTime Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 554BDescriptionOhana Matsumae is trying to clean a

2016-08-22 20:48:43 339

原创 CodeForces 660A Co-prime Array

A - Co-prime ArrayTime Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 660ADescriptionYou are given an array of n elem

2016-08-22 20:34:12 325

原创 南理oj 不是匹配

不是匹配时间限制:1000 ms  |  内存限制:65535 KB描述 有N个人,N个活动, 每个人只会对2个或者3个活动感兴趣, 每个活动也只有两个人或者两个活动对它兴趣,每个人参加一个 感兴趣的活动需要一天 ,且当天该活动被参加时,其他的人不能参加 如果每个人都参加完自己有兴趣的活动,应当怎样安排使得所用总天数时间最短2输入

2016-08-22 08:53:16 368

原创 HDJ 1856 More is better

More is betterTime Limit: 5000/1000 MS (Java/Others)    Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 24651    Accepted Submission(s): 8849Problem DescriptionMr Wang

2016-08-15 21:34:47 245

原创 HDOJ 1325 Is It A Tree?

Is It A Tree?Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22086    Accepted Submission(s): 4996Problem DescriptionA tree is a

2016-08-15 21:17:53 245

原创 HDOJ 1272 小希的迷宫

小希的迷宫Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44066    Accepted Submission(s): 13614Problem Description上次Gardon的迷宫城堡小希玩了很

2016-08-15 21:10:28 253

原创 HDOJ 1213 How Many Tables

How Many TablesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24893    Accepted Submission(s): 12427Problem DescriptionToday is

2016-08-15 20:30:45 275

原创 HDOJ 1232 畅通工程

畅通工程Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47393    Accepted Submission(s): 25219Problem Description某省调查城镇交通状况,得到现有城镇道路

2016-08-15 20:27:44 241

原创 HDOJ 1155 Bungee Jumping

Bungee JumpingTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1126    Accepted Submission(s): 476Problem DescriptionOnce again,

2016-08-13 17:23:07 299

原创 LightOJ1104 birthday parado(经典概率)

DescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is

2016-08-13 17:20:34 245

原创 LightOJ 1058 Parallelogram Counting(数学)

DescriptionThere are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points. In other words, find the number of 4-

2016-08-13 17:14:03 340

原创 HDOJ 1061 Rightmost Digit

Rightmost DigitTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 48109    Accepted Submission(s): 18247Problem DescriptionGiven a

2016-08-12 20:47:20 489

原创 HDOJ 2035 人见人爱A^B

人见人爱A^BTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35605    Accepted Submission(s): 24216Problem Description求A^B的最后三位数表示的整数。

2016-08-12 20:44:22 278

原创 POJ 1995 Raising Modulo Numbers

Raising Modulo NumbersTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6648 Accepted: 3958DescriptionPeople are different. Some secretly read magazines f

2016-08-12 20:16:03 220

原创 模运算的规则

运算规则模运算与基本四则运算有些相似,但是除法例外。其规则如下:(a + b) % p = (a % p + b % p) % p (1)(a – b) % p = (a % p – b % p) % p (2)(a * b) % p = (a % p * b % p) % p (3)(a^b) % p = ((a % p)^b) % p (4)结合

2016-08-12 18:02:17 1700

原创 POJ 3641 Pseudoprime numbers(快速幂,素数)

Pseudoprime numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8886 Accepted: 3746DescriptionFermat's theorem states that for any prime number p and

2016-08-12 17:55:36 266

原创 HDOJ 2066 一个人的旅行(dijkstra)

一个人的旅行Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32341    Accepted Submission(s): 11140Problem Description虽然草儿是个路痴(就是在杭电待了一

2016-08-12 16:22:02 281

原创 HDOJ 5363 Key Set

Key SetTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1870    Accepted Submission(s): 983Problem Descriptionsoda has a set S 

2016-08-11 20:37:40 312

转载 快速幂讲解

快速幂取模算法在网站上一直没有找到有关于快速幂算法的一个详细的描述和解释,这里,我给出快速幂算法的完整解释,用的是C语言,不同语言的读者只好换个位啦,毕竟读C的人较多~所谓的快速幂,实际上是快速幂取模的缩写,简单的说,就是快速的求一个幂式的模(余)。在程序设计过程中,经常要去求一些大数对于某个数的余数,为了得到更快、计算范围更大的算法,产生了快速幂取模算法。[有读者反映在讲快速幂部

2016-08-11 16:56:53 291

原创 小火山的围棋梦想

1908: 小火山的围棋梦想Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 372  Solved: 108SubmitStatusWeb BoardDescription  小火山最近喜欢上了围棋。  对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也会

2016-08-11 16:29:07 514

原创 小火山的跳子游戏

1905: 小火山的跳子游戏Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 462  Solved: 107SubmitStatusWeb BoardDescription  小火山和火山火山在一块玩跳子游戏。规则如下:  1:跳子的起始位置为0,棋盘大小从1到N  2:每次跳子跳k步。 例如当前位置为i, 那么

2016-08-11 11:11:19 391

原创 zzulioj 1913 小火山的计算能力

小火山的计算能力Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 473  Solved: 124SubmitStatusWeb BoardDescription别人说小火山的计算能力不行,小火山很生气,于是他想证明自己,现在有一个表达式,他想计算出来。Input首先是一个t(1Output

2016-08-11 09:48:56 315

原创 POJ 1363 Rails

RailsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31579 Accepted: 12287DescriptionThere is a famous railway station in PopPush City. Country there is

2016-08-09 21:33:24 370

原创 HDOJ 1702 ACboy needs your help again!

ACboy needs your help again!Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5720    Accepted Submission(s): 2996Problem Descri

2016-08-09 21:11:19 216

原创 HDOJ 4883 TIANKENG’s restaurant

TIANKENG’s restaurantTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 2604    Accepted Submission(s): 978Problem DescriptionTIAN

2016-08-09 20:46:06 216

原创 HDOJ 2124 Repair the Wall

Repair the WallTime Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3679    Accepted Submission(s): 1830Problem DescriptionLong time

2016-08-09 20:39:30 283

原创 HDOJ 2111 Saving HDU

Saving HDUTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9719    Accepted Submission(s): 4542Problem Description话说上回讲到海东集团面临内

2016-08-09 20:34:45 248

原创 HDOJ 2037 今年暑假不AC

今年暑假不ACTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47516    Accepted Submission(s): 25556Problem Description“今年暑假不AC?”“是的。

2016-08-09 20:27:49 335

原创 HDOJ 1789 Doing Homework again

Doing Homework againTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11637    Accepted Submission(s): 6837Problem DescriptionIgna

2016-08-09 20:19:33 219

原创 HDOJ 1009 FatMouse' Trade

FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 67166    Accepted Submission(s): 22860Problem DescriptionFatMou

2016-08-09 20:10:02 208

原创 HDOJ 2544 最短路

最短路Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 54835    Accepted Submission(s): 24194Problem Description在每年的校赛里,所有进入决赛的同学都

2016-08-09 18:01:58 247

原创 dijkstra求最短路思想与模板

Dijkstra算法Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。时间复杂度O(N^2);注意:1,不能求含有负权的图,含有负权可以采Bellman-ford和SPFA算。2.不能直接求单源最长路径具体算法实现,传送门点击打开链接下面是代码模板void dijkstra

2016-08-09 17:05:48 398 1

原创 HDOJ 1231 最大连续子序列

最大连续子序列Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28199    Accepted Submission(s): 12808Problem Description给定K个整数的序列{ N

2016-08-09 11:45:50 263

空空如也

空空如也

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

TA关注的人

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