自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 博客园地址

https://www.cnblogs.com/1shengxiao1/

2019-07-23 16:52:07 247

原创 食物链(并查集)

食物链动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y"...

2019-06-28 10:01:34 821

原创 E - Match Points (二分答案)

You are given a set of pointsx1x1,x2x2, ...,xnxnon the number line.Two pointsiiandjjcan be matched with each other if the following conditions hold:neitheriinorjjis matched with any ot...

2019-05-24 21:15:31 367

原创 A Tale of Two Lands (二分)

The legend of the foundation of Vectorland talks of two integersxxandyy. Centuries ago, the array king placed two markers at points|x||x|and|y||y|on the number line and conquered all the land i...

2019-05-24 21:11:01 482

原创 G - Left and Right

With modern technology advancement, it is now possible to deliver mail with a robot! There is a neighborhood on a long horizontal road, on which there are n houses numbered 1 to n from left to right. ...

2019-05-04 19:06:13 408 1

原创 K - Run-Length Encoding, Run!

Forrest lives in a prehistoric era of “dial-up Internet.” Unlike the fast streaming of today’s broadband era, dial-up connections are only capable of transmitting small amounts of text data at reasona...

2019-05-04 19:04:26 563

原创 B - Das Blinkenlights

There are two lights that blink at regular intervals. When each one blinks, it turns on and then immediately back off; they don’t toggle. They are both off at time t=0. The first one blinks at t=p,2p,...

2019-05-04 19:02:17 355 1

原创 Problem H. Huashui Clock

For those who don’t speak Chinese, huashui may not even be a legitimate word for you. You don’t haveto know what it is to solve this problem, but to make everything clear, huashui refers to the status...

2019-05-03 21:22:45 198

原创 D - Hoppers

You are part of an elite hacking group who has just invented a new type of malware, called the hoppers. Hoppers can operate in any high-security computer networks; however, they can only propagate the...

2019-05-03 21:03:10 703

原创 G - Non-Prime Factors(素数筛+质因分解)

In many programming competitions, we are asked to find (or count the number of) Prime Factors of an integer i. This is boring. This time, let’s count the number of Non-Prime Factors of an integer i, ...

2019-05-03 19:11:49 160

原创 C - Free Food

Do you know what attracts almost any college student to participate in an event? Yes, free food. It doesn’t matter whether the event involves a long (sometimes boring) seminar. As long as free food is...

2019-05-03 19:09:54 810

原创 D - Bomb数位dp

D - BombThe counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number seq...

2019-05-03 09:27:45 191

原创 C - 不要62 数位dp

杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之列。...

2019-05-03 09:11:44 153

原创 B. Tiling Challenge

B. Tiling Challengetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alice was cleaning up her basement when she noticed something ...

2019-05-02 21:15:07 153

原创 A. Stock Arbitraging

A. Stock Arbitragingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWelcome to Codeforces Stock Exchange! We’re pretty limited now as we c...

2019-05-02 21:14:48 173

原创 A. Inscribed Figures

A. Inscribed Figurestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe math faculty of Berland State University has suffered the sudden d...

2019-05-02 21:14:30 222

原创 A - 两只脑斧 Gym - 102174A

天天最近想要学习用口琴给筝筝吹情歌,但是他以前从来没有学过口琴,只能从最简单的两只脑斧开始学。而口琴有时吸气有时吹气的吹法让天天傻傻地分不清,所以他就只能拿着乐谱来找聪明的你了,快帮帮他!已知天天使用的是 24孔口琴,其音阶图如下,其中 1,2,⋯,7 七个阿拉伯数字表示基本的音阶,数字上方有.或:的音阶则分别表示该音阶的音调将在原音阶基础上增高一个八度或两个八度,例如音阶 3 的高八度为 3...

2019-05-02 21:14:17 525

原创 C. 赛尔逵传说

C. 赛尔逵传说time limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard output天天最近买了一台思维吃来玩赛尔逵传说。赛尔逵传说需要玩家扮演近侍骑士森克从恶魔噶里嗷的手里救下赛尔逵公主。但是救出公主的路途异常艰险,噶里嗷在去城堡的路途上设置了

2019-05-02 21:13:56 353

原创 K. 多项式求导

K. 多项式求导time limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard output一元多项式形如

2019-05-02 21:13:43 1696

原创 F. 风王之瞳

F. 风王之瞳time limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard output如果莫名流泪,也许是失去了什么美好的回忆。伪装成人类少女夏弥的龙王耶梦加得曾在暗中默默观察了这个名叫楚子航的男孩很多年。后来,她以学妹的身份正面出现在楚子航身边,一边作战,一边还讲着白...

2019-05-02 21:10:53 637 2

原创 E. 只有一端开口的瓶子

E. 只有一端开口的瓶子time limit per test1.0 smemory limit per test256 MBinputstandard inputoutputstandard output栈就是像 “只有一端开口的瓶子” 一样的数据结构,大家可以理解为一个头部固定的数组,无论是取出数字还是放入数字,你都只能在数组末尾那一端(称为栈顶)修改。非常喜欢数据结构的周...

2019-05-02 21:09:37 217

原创 7989买砝码

7989买砝码Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description7989学长热爱做实验,为了实验,她要精确的知道物品的质量,天平的任意一边都能放置砝码,她想自己设计一套砝码,每一个砝码的质量都是正整数 (质量由你来定,保证每个砝码的质量<1e5),她想测出n(n<1e5)以内所有正整数的质量,众所周知7...

2019-03-02 21:43:24 216

原创 easy cut problem

Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description在序列中将a[i]和a[i+1]切割开的花费为abs ( a[i] - a[i+1] ) ,现在要使切割后的每一段中的奇数和偶数数量相等,问总花费不超过m的最大切割次数,保证序列中的奇数与偶数数量相等。Inputn,m。代表序列长度与最大花费。第二行n个正整数表示序...

2019-03-02 21:28:13 151 3

原创 easy binary problem

Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description给你一个长度不大于1e5的二进制字符串。你可以对其中的任意一位进行修改,问在n次操作内能否使其能被32整除。Input第一行一个数字代表最大的操作数。第二行一个不长于1e5的二进制串。Output若可以则输出“yes”,否则输出"no"。Sample Inpu...

2019-03-02 21:27:13 238

转载 DFS和BFS

DFS 算法思想:一直往深处走,直到找到解或者走不下去为止BFS算法DFS:使用栈保存未被检测的结点,结点按照深度优先的次序被访问并依次被压入栈中,并以相反的次序出栈进行新的检测。BFS:使用队列保存未被检测的结点。结点按照宽度优先的次序被访问和进出队列。框架:BFS:#include<cstdio>#include<cstring>#include&lt...

2019-02-27 16:52:03 102

原创 sdut B - 【红色】北理工的恶龙(这题有点坑)

标题sdut B - 【红色】北理工的恶龙北理工的恶龙其实并没有被完全杀死,但是恶龙的身体却发生了很大的变化。恶龙仍然长有n个头,但经过了勇士的调教,恶龙变得善良了一些。它的n个头每个头要么仍是邪恶的头,用"1"表示,要么已经变得善良,用"0"表示,因而恶龙的n个头就可以用n位01串来表示。你作为被选召的勇

2019-02-23 12:34:46 894

原创 AC me(15)

Ignatius is doing his homework now. The teacher gives him some articles and asks him to tell how many times each letter appears.It’s really easy, isn’t it? So come on and AC ME.InputEach article co...

2019-02-22 21:13:25 746

转载 数据结构实验之栈与队列二:一般算术表达式转换成后缀式

数据结构实验之栈与队列二:一般算术表达式转换成后缀式 Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。Input输入一个算术表达式,以‘#’字符作为结束标志。Output输出该表达式转换所得到的后缀式。Sample...

2019-02-20 21:21:20 327

原创 csdn 最少拦截系统((贪心)

csdn 最少拦截系统((贪心) 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请...

2019-02-20 20:22:42 569 1

转载 SDUT 3386 小雷的冰茶几(并查集)

Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description小雷有个特殊的癖好,平时喜欢收藏各种稀奇古怪的东西,譬如。。。。,还有。。。。,也包括。。。。。小雷是一个喜欢分享的童鞋,这次小雷又给大家带来一套神奇的东西,那就是举世无双的冰茶几!顾名思义,这些茶几被冰冻住了,最主要的是他们是易碎品,毕竟被冻住了。因此小雷要很小心翼翼...

2019-02-20 20:02:55 111

原创 D - ZJUTACM(简单模拟)

欢迎参加浙江工业大学第四届程序设计竞赛!但是,请稍等!裁判Joe说了,必须正确回答他的问题,才可以看到PIPI的气球MM,KUKU的气球GG.Joe手上有7张卡片,每张卡片上有一个大写字母,分别是Z,J,U,T,A,C,M.现在他开始表演魔术,每次只交换其中的两张卡片.等表演结束后,请你指出含有字母J的那张卡片.Input第一行正整数N(1<=N<=1000)表示其后有N组...

2019-02-20 20:01:53 272

原创 sdut-2798 小鑫的城堡

Time Limit: 1000 ms Memory Limit: 65536 KiB sdut题目链接Problem Description从前有一个国王,他叫小鑫。有一天,他想建一座城堡,于是,设计师给他设计了好多简易图纸,主要是房间的连通的图纸。小鑫希望任意两个房间有且仅有一条路径可以相通。小鑫现在把设计图给你,让你帮忙判断设计图是否符合他的想法。比如下面的例子,第一个是符合条件的,但是...

2019-02-20 15:58:37 97

空空如也

空空如也

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

TA关注的人

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