自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Baiyi_destroyer的博客

蒟蒻,大佬请指教

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

原创 Permutation(思维题)

DescriptionA permutationp is an ordered group of numbers p1,   p2,   ...,   pn, consisting of n distinct positive integers, each is no more than n. We'll define number n as the length of permutation p...

2018-03-31 23:11:52 421

转载 字符串匹配的KMP算法(1)

  举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD"?  许多算法可以完成这个任务,Knuth-Morris-Pratt算法(简称KMP)是最常用的之一。它以三个发明者命名,起头的那个K就是著名科学家Donald Knuth。   这种算法不太容易理解,网上有很多解释,但读起来都很费劲。直到读到Jake Boxer的文章...

2018-03-31 11:59:07 174 1

原创 Weighted Median(水题)

Description For n elements x1, x2, ..., xn with positive integer weights w1, w2, ..., wn. The weighted median is the element xk satisfying  and   , S indicates  Can you compute the weighted ...

2018-03-29 22:35:45 654

原创 Exams(思维题)

DescriptionOne day the Codeforces round author sat exams. He had n exams and he needed to get an integer from 2 to 5 for each exam. He will have to re-sit each failed exam, i.e. the exam that gets mar...

2018-03-28 21:59:49 312

原创 Full Binary Tree(二叉树)

 DescriptionIn computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (each node has two children except the le...

2018-03-28 20:20:09 323

原创 Martian Addition(水题,zoj1205,进制问题)

  DescriptionIn the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics. Every year, they would hold an Arithmetic Contest on M...

2018-03-28 16:45:21 333

原创 Language of FatMouse(水题,zoj1109)

 DescriptionWe all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Thanks to Turing we have computers to help him.InputInput consis...

2018-03-28 16:12:12 361

原创 Windows Message Queue(水题)

DescriptionMessage queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the...

2018-03-28 12:51:30 249

原创 括号配对问题

这里举了两个例子,都是用栈做的,题目很水,就不过多解释了,相信大佬们都能看懂。(1) Description现在有一种只包括左右小括号(“(”和“)”)和空格(” “)的字符串序列,请你判断括号是否匹配,如果匹配就输出Yes,不匹配输出No。Input输入数据第一行输入一个T(0≤T≤100),表示测试数据的组数。接下来有T行测试数据,每行有一个符合题意的字符串,字符串...

2018-03-27 22:09:55 255

原创 队列

 以下三题都为简单的队列问题,就不再过多解释了,网上对队列讲解很多,有兴趣的可以去深度学习一下。                                                                约瑟夫环 Description题目:n个数字(1,2,3…,n)形成一个圆圈,从数字1开始,每次从这个圆圈中删除第m个数字(第一个为当前数字本身,第二个为...

2018-03-27 22:03:10 172

原创 最大收益问题(水题,暴力矩阵)

 Description铁牌狗最近迷上了一款游戏,但铁牌狗实在是太笨了,他还是要请求你的帮助。 有一个n行m列的矩阵A,矩阵A中每个数字均为正整数,现在铁牌狗要在其中选出一个r行c列的子矩阵B,这个子矩阵B中各个数字之和即为铁牌狗的得分,请你帮铁牌狗计算出他的最高得分是多少。 Input首先输入一个组数T(1 <= T <= 10),表示接下来要输入T组数据...

2018-03-27 21:42:24 698

原创 DNA Sorting(水题)

DescriptionOne measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this measu...

2018-03-27 20:57:54 1065

原创 经济节约(水题)

Description由于经济紧张,某国国王决定减少一部分多余的士兵,这些士兵在边界都有各自的管辖范围。例如,士兵x 的管辖范围[ax,bx]。我们定义:对于i号士兵,如果存在j号士兵的管辖范围[aj,bj], aji且bij成立,那么i号士兵就是多余的。给出多个士兵的管辖范围,问有多少个士兵是多余的? Input 有多组数据,每组数据的第一行为一个整数n(1<=n<=100000),...

2018-03-27 20:48:42 216

原创 LCM的个数

Description对于我们来说求两个数的LCM(最小公倍数)是很容易的事,现在我遇到了一个问题需要大家帮助我来解决这问题,问题是:给你一个数n,然后统计有多少对(a<=b) LCM(a,b)=n;例如LCM(a,b)=12; 即(1,12),(2,12),(3,12),(4,12),(6,12),(12,12),(3,4),(4,6); Input 输入数组有多组,每...

2018-03-27 20:27:09 149

原创 Light Bulb(三分/推公式)

DescriptionCompared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommo...

2018-03-27 20:09:49 383

原创 Tell me the area(思维题)

Problem Description    There are two circles in the plane (shown in the below picture), there is a common area between the two circles. The problem is easy that you just tell me the common area. Input...

2018-03-27 19:31:16 214

原创 环形博弈

博弈的题很多,我就用两道经典题来讲解一下。SDUT 3253Game!Problem DescriptionOne day, zbybr is playing a game with blankcqk, here are the rules of the game:There is a circle of N stones, zbybr and blankcqk t...

2018-03-27 19:17:05 878 4

原创 File Searching(水题,文件查找)

 DescriptionHave you ever used file searching tools provided by an operating system? For example, in DOS, if you type "dir *.exe", the OS will list all executable files with extension "exe" in the...

2018-03-27 09:44:53 589

转载 快排

C:qsort要加上头文件#include< stdlib.h > 1.对int一维数组快速排序(char 类似)#include<stdio.h>#include<stdlib.h>int cmp( const  void  *a,const  void *b){    return *(int *)a-*(int *)b;}int ...

2018-03-26 18:40:33 376

原创 FatMouse' Trade

DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J[i] ...

2018-03-26 18:34:13 533

空空如也

空空如也

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

TA关注的人

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