自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

海岛Blog

海是无垠的,岛在海中是独立的,有一片自己的天空

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

原创 UVALive12627 Erratic Expansion【组合+递推】

Piotr found a magical box in heaven. Its magic power is that if you place any red balloon inside it then, after one hour, it will multiply to form 3 red and 1 blue colored balloons. Then in the next h...

2018-08-31 08:51:01 374

原创 POJ2155 Matrix【二维树状数组】

MatrixTime Limit: 3000MS   Memory Limit: 65536K Total Submissions: 33133   Accepted: 11997 DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the num...

2018-08-29 09:05:48 392

原创 POJ2229 HDU2709 Sumsets【数列】

SumsetsTime Limit: 2000MS   Memory Limit: 200000K Total Submissions: 23695   Accepted: 9112 DescriptionFarmer John commanded his cows to search for different sets of numbers that s...

2018-08-28 20:52:08 511

原创 UVA10324 Zeros and Ones【水题】

Given a string of 0’s and 1’s up to 1000000 characters long and indices i and j, you are to answer a question whether all characters between position min(i, j) and position max(i, j) (inclusive) are t...

2018-08-28 19:44:41 462 1

原创 UVA10220 I Love Big Numbers !【大数】

A Japanese young girl went to a Science Fair at Tokyo. There she met with a Robot named Mico-12, which had AI (You must know about AI-Artificial Intelligence). The Japanese girl thought, she can do so...

2018-08-28 17:53:33 673

原创 HDU4911 Inversion【逆序偶+归并排序】

InversionTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 6357    Accepted Submission(s): 2179 Problem Descriptionbobo has a sequence a...

2018-08-28 00:31:58 852

原创 POJ1804 Brainman【逆序偶+归并排序】

BrainmanTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 12463   Accepted: 6288 DescriptionBackground Raymond Babbitt drives his brother Charlie mad. Recently Raymond ...

2018-08-28 00:16:56 576

原创 Bailian2748 全排列【全排列】(POJ NOI0202-1750)

问题链接:POJ NOI0202-1750 全排列。 2748:全排列描述给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列。 我们假设对于小写字母有'a' < 'b' < ... < 'y' < 'z',而且给定的字符串中的字母已经按照从小到大的顺序排列。输入输入只有一行,是一个由不同的小写字母组成的字符串,已知字符串的长度在1到6之...

2018-08-27 23:27:51 920

原创 Bailian4047 全排列【全排列】

4070:全排列描述对于数组[1, 2, 3],他们按照从小到大的全排列是1 2 31 3 22 1 32 3 13 1 23 2 1现在给你一个正整数n,n小于8,输出数组[1, 2, …,n]的从小到大的全排列。 输入输入有多行,每行一个整数。当输入0时结束输入。输出对于每组输入,输出该组的全排列。每一行是一种可能的排列,共n个整数,每个...

2018-08-27 22:54:26 747

原创 51Nod-1383 整数分解为2的幂【数列】

1383 整数分解为2的幂 任何正整数都能分解成2的幂,给定整数N,求N的此类划分方法的数量!由于方案数量较大,输出Mod 1000000007的结果。比如N = 7时,共有6种划分方法。7=1+1+1+1+1+1+1  =1+1+1+1+1+2  =1+1+1+2+2  =1+2+2+2  =1+1+1+4  =1+2+4Input输入一个数N(1 <= N ...

2018-08-27 22:30:30 502

原创 51Nod-1019 逆序数【逆序偶+归并排序】

1019 逆序数 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。Input第1行:N,N为序列的长度(n <= 50000)第2 - N + 1行:序列中的元素(0 &lt...

2018-08-27 21:49:21 415

原创 51Nod-1384 全排列【全排列】

1384 全排列 给出一个字符串S(可能有重复的字符),按照字典序从小到大,输出S包括的字符组成的所有排列。例如:S = "1312",输出为: 112311321213123113121321211321312311311231213211Input输入一个字符串S(S的长度 <= 9,且只包括0 - 9的阿拉伯数字)...

2018-08-27 21:36:07 493

原创 51Nod-1284 2 3 5 7的倍数【数位DP+记忆化搜索】

1284 2 3 5 7的倍数 给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数。 例如N = 10,只有1不是2 3 5 7的倍数。Input输入1个数N(1 <= N <= 10^18)。Output输出不是2 3 5 7的倍数的数共有多少。Input示例10Output示例1 问题链接:51Nod-1284 2 3 ...

2018-08-27 00:49:59 450

原创 51Nod-1009 数字1的数量【数位DP+记忆化搜索】

1009 数字1的数量 给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。Input输入N(1 <= N <= 10^9)Output输出包含1的个数Input示例12Output示例5 问题链接:51Nod-...

2018-08-27 00:00:52 359

原创 HDU3652 B-number【数位DP+记忆化搜索】

B-numberTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8659    Accepted Submission(s): 5146 Problem DescriptionA wqb-number, or B-numbe...

2018-08-26 23:28:14 467

原创 HDU3555 Bomb【数位DP+记忆化搜索】

BombTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 23077    Accepted Submission(s): 8683 Problem DescriptionThe counter-terrorists fou...

2018-08-25 23:47:47 443

原创 HDU2089 不要62【数位DP+记忆化搜索】

不要62Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 57271    Accepted Submission(s): 22409 Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)...

2018-08-24 09:58:36 898

原创 POJ2193 ZOJ2193 UVALive3144 Lenny's Lucky Lotto Lists【DP】

Lenny's Lucky Lotto ListsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2191   Accepted: 953 DescriptionLenny likes to play the game of lotto. In the lotto game, he p...

2018-08-23 22:58:32 584

原创 POJ2245 HDU1342 ZOJ1089 UVA441 Lotto【DFS】

LottoTime Limit:1000MS Memory Limit:65536K Total Submissions:7111 Accepted:4486 DescriptionIn the German Lotto you have to select 6 numbers from the set {1,2,...,49}. A pop...

2018-08-23 09:37:45 562 2

原创 POJ3983 快算24【暴力】

快算24Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5375   Accepted: 3245 Description给定4个不大于10的正整数(范围1-10),要求在不改变数据先后顺序的情况下,采用加减乘除四种运算,找到一个表达式,使得最后的结果是24。Input4个不大...

2018-08-21 20:14:30 1249

原创 Bailian2787 算24【DFS】(POJ NOI0205-1789)

问题链接:POJ NOI0205-1789 算24。 2787:算24描述给出4个小于10个正整数,你可以使用加减乘除4种运算以及括号把这4个数连接起来得到一个表达式。现在的问题是,是否存在一种方式使得得到的表达式的结果等于24。这里加减乘除以及括号的运算结果和运算的优先级跟我们平常的定义一致(这里的除法定义是实数除法)。比如,对于5,5,5,1,我们知道5 * (5 – 1 ...

2018-08-21 18:31:28 958

原创 HDU1427 速算24点【DFS】

速算24点Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6309    Accepted Submission(s): 1621 Problem Description速算24点相信绝大多数人都玩过。就是随机给你四张牌,包...

2018-08-21 12:04:58 1178

原创 UVA10344 23 out of 5【暴力+DFS】

Your task is to write a program that can decide whether you can find an arithmetic expression consisting of five given numbers ai (1 ≤ i ≤ 5) that will yield the value 23.  For this problem we will ...

2018-08-21 08:13:48 499 1

原创 UVA10726 Coco Monkey【暴力+模拟】

This is the story of a time long ago. There were these sailors stranded on a beautiful island full off coconut trees. And what do our sailors do with the coconut trees? They collect all the coconuts a...

2018-08-21 02:32:07 466

原创 POJ1309 HDU1346 ZOJ1269 UVA616 UVALive5462 Coconuts, Revisited【暴力+模拟】

Coconuts, RevisitedTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2171   Accepted: 885 DescriptionThe short story titled Coconuts, by Ben Ames Williams, appeared in t...

2018-08-20 23:28:08 765

原创 POJ2260 ZOJ1949 UVA541 Error Correction【水题】

Error CorrectionTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7020   Accepted: 4399 DescriptionA boolean matrix has the parity property when each row and each column...

2018-08-20 11:25:15 365

原创 POJ2027 ZOJ2201 UVALive3077 No Brainer【水题】

No BrainerTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 28441   Accepted: 18710 DescriptionZombies love to eat brains. Yum.InputThe first line contains a single ...

2018-08-19 23:42:31 405

原创 POJ3062 ZOJ3124 UVA1124 UVALive2581 Celebrity jeopardy【水题】

Celebrity jeopardyTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16904   Accepted: 9503 DescriptionIt's hard to construct a problem that's so easy that everyone will ...

2018-08-19 23:03:40 383

原创 POJ1013 HDU1482 ZOJ1184 UVA608 UVALive5410 Counterfeit Dollar【暴力】

Counterfeit DollarTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 51575   Accepted: 16133 DescriptionSally Jones has a dozen Voyageur silver dollars. However, only ele...

2018-08-19 22:10:55 400

原创 Bailian2692 假币问题【暴力】

2692:假币问题描述赛利有12枚银币。其中有11枚真币和1枚假币。假币看起来和真币没有区别,但是重量不同。但赛利不知道假币比真币轻还是重。于是他向朋友借了一架天平。朋友希望赛利称三次就能找出假币并且确定假币是轻是重。例如:如果赛利用天平称两枚硬币,发现天平平衡,说明两枚都是真的。如果赛利用一枚真币与另一枚银币比较,发现它比真币轻或重,说明它是假币。经过精心安排每次的称量,赛利保证在称三次...

2018-08-19 21:49:36 2106

原创 Bailian2756 二叉树(POJ NOI0306-1758)【二叉树】

问题链接:POJ NOI0306-1758 二叉树。2756:二叉树描述如上图所示,由正整数1, 2, 3, ...组成了一棵无限大的二叉树。从某一个结点到根结点(编号是1的结点)都有一条唯一的路径,比如从10到根结点的路径是(10, 5, 2, 1),从4到根结点的路径是(4, 2, 1),从根结点1到根结点的路径上只包含一个结点1,因此路径就是(1)。对于两个结点x和y...

2018-08-19 08:37:23 608

原创 HDU5687 Problem C【字典树】

Problem CTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2669    Accepted Submission(s): 736 Problem Description度熊手上有一本神奇的字典,你可以在它里面做如...

2018-08-18 23:19:29 478

原创 POJ2590 UVA846 ZOJ1871 Steps【模拟】

StepsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8304   Accepted: 3783 DescriptionOne steps through integer points of the straight line. The length of a step must ...

2018-08-18 00:03:26 458

原创 POJ2140 HDU2715 Herd Sums【数学】

Herd SumsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18804   Accepted: 10991 DescriptionThe cows in farmer John's herd are numbered and branded with consecutive in...

2018-08-17 21:52:42 333

原创 POJ2305 ZOJ1929 UVA10551 Basic remains【进制+大数模除】

Basic remainsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5619   Accepted: 2414 DescriptionGiven a base b and two non-negative base b integers p and m, compute p mo...

2018-08-17 21:35:33 421

原创 HDU5363 Key Set【快速模幂】

Key SetTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2757    Accepted Submission(s): 1380 Problem Descriptionsoda has a set S with n...

2018-08-17 20:52:24 324

原创 HDU1248 寒冰王座【0/1背包+DP】

寒冰王座Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20946    Accepted Submission(s): 10907 Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(...

2018-08-17 19:41:30 889 1

原创 CCF201703-3 Markdown(100分)【文本处理】

试题编号: 201703-3 试题名称: Markdown 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述   Markdown 是一种很流行的轻量级标记语言(lightweight markup language),广泛用于撰写带格式的文档。例如以下这段文本就是用 Markdown 的语法写成的:    ...

2018-08-16 23:25:42 5622 3

原创 CCF201709-3 JSON查询(100分)【文本处理】

问题描述 JSON (JavaScript Object Notation) 是一种轻量级的数据交换格式,可以用来描述半结构化的数据。JSON 格式中的基本单元是值 (value),出于简化的目的本题只涉及 2 种类型的值: * 字符串 (string):字符串是由双引号 " 括起来的一组字符(可以为空)。如果字符串的内容中出现双引号 ",在双引号前面加反斜杠,也就是用 \...

2018-08-16 18:03:34 6651 11

原创 CCF201712-3 Crontab(100分)【模拟+文本处理】

样例输入3 201711170032 2017112223520 7 * * 1,3-5 get_up30 23 * * Sat,Sun go_to_bed15 12,18 * * * have_dinner样例输出201711170700 get_up201711171215 have_dinner201711171815 have_dinner20171118121...

2018-08-16 00:47:16 8551 8

空空如也

空空如也

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

TA关注的人

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