自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 第15届浙江省赛 E LIS

LISTime Limit: 1 Second      Memory Limit: 65536 KB      Special JudgeDreamGrid is learning the LIS (Longest Increasing Subsequence) problem and he needs to find the longest increasing subsequence of ...

2018-04-30 22:18:50 240

原创 第15届浙江省赛 D Sequence Swapping(dp)

Sequence SwappingTime Limit: 1 Second      Memory Limit: 65536 KBBaoBao has just found a strange sequence {<, >, <, >, , <, >} of length  in his pocket. As you can see, each element ...

2018-04-30 22:10:43 264

原创 第十五届浙江省赛 F Now Loading!!!

Now Loading!!!Time Limit: 1 Second      Memory Limit: 131072 KBDreamGrid has  integers . DreamGrid also has  queries, and each time he would like to know the value offor a given number , where , .Inpu...

2018-04-30 21:59:51 459

原创 北京师范大学第十六届程序设计竞赛决赛-重现赛 F-汤圆防漏理论(二分+拓扑排序)

链接:https://www.nowcoder.com/acm/contest/117/F来源:牛客网题目描述 ghc很喜欢吃汤圆,但是汤圆很容易被粘(zhān)漏。 根据多年吃汤圆经验,ghc总结出了一套汤圆防漏理论: 互相接触的汤圆容易粘(zhān)在一起,并且接触面积不同,粘(zhān)在一起的粘(nián)度也不同。 当ghc要夹起一个汤圆时,这个汤圆和现在碗里与这个汤圆接触的所有汤圆之...

2018-04-30 21:48:42 346

原创 牛客练习赛16C-任意点(并查集)

链接:https://www.nowcoder.com/acm/contest/84/C来源:牛客网题目描述平面上有若干个点,从每个点出发,你可以往东南西北任意方向走,直到碰到另一个点,然后才可以改变方向。 请问至少需要加多少个点,使得点对之间互相可以到达。输入描述:第一行一个整数n表示点数( 1 <= n <= 100)。第二行n行,每行两个整数xi, yi表示坐标( 1 <...

2018-04-30 21:42:15 268

原创 牛客练习赛16 B-漂亮的树

链接:https://www.nowcoder.com/acm/contest/84/B来源:牛客网题目描述街上有n棵树,标号为1...n,第i棵树的高度为ai。 定义这n棵树是漂亮的,当且仅当     1. 对于所有的i,ai=an-i+1;     2. 对于1 <= i < n / 2 (不是整除),ai + 1= ai + 1; 比如说 “2 3 4 5 5 4 3 2”和“1...

2018-04-30 21:27:32 216

原创 SCU 4441: Necklace(dp+树状数组)

Necklacefrog has nn gems arranged in a cycle, whose beautifulness are a1,a2,…,ana1,a2,…,an. She would like to remove some gems to make them into a beautiful necklacewithout changing their relative ord...

2018-04-27 23:08:59 344 3

原创 SCU 4438 Censor(字符串哈希)

Censorfrog is now a editor to censor so-called sensitive words (敏感词).She has a long text pp. Her job is relatively simple -- just to find the first occurence of sensitive word ww and remove it.frog re...

2018-04-27 23:07:08 818

原创 POJ 3903 Stock Exchange(树状数组求最长上升子序列)

Stock ExchangeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions:8000 Accepted: 2775DescriptionThe world financial crisis is quite a subject. Some people are more relaxed while others are quite ...

2018-04-27 16:39:59 442 1

原创 SCU 4444 Travel(bfs)

TravelThe country frog lives in has nn towns which are conveniently numbered by 1,2,…,n1,2,…,n.Among n(n−1)2n(n−1)2 pairs of towns, mm of them are connected by bidirectional highway, which needs aa mi...

2018-04-27 00:30:05 245 1

原创 SCU 4440 Rectangle(dp)

Rectanglefrog has a piece of paper divided into nn rows and mm columns. Today, she would like to draw a rectangle whose perimeter is not greater than kk.There are 88 (out of 99) ways when n=m=2,k=6n=m...

2018-04-27 00:23:37 227

原创 SCU 4439: Vertex Cover(最小顶点覆盖)

Vertex Coverfrog has a graph with nn vertices v(1),v(2),…,v(n)v(1),v(2),…,v(n) and mm edges (v(a1),v(b1)),(v(a2),v(b2)),…,(v(am),v(bm))(v(a1),v(b1)),(v(a2),v(b2)),…,(v(am),v(bm)).She would like to col...

2018-04-26 23:56:56 2040

原创 SCU 4437 Carries

Carriesfrog has nn integers a1,a2,…,ana1,a2,…,an, and she wants to add them pairwise.Unfortunately, frog is somehow afraid of carries (进位). She defines hardness h(x,y)h(x,y) for adding xx and yy the n...

2018-04-26 23:53:00 168

原创 POJ 2987 Firing(最大权闭合图)

FiringTime Limit: 5000MS Memory Limit: 131072KTotal Submissions:11472 Accepted: 3468DescriptionYou’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. Yo...

2018-04-25 23:28:44 236

原创 ZOJ 3940 Modulo Query(区间取模)

Modulo QueryTime Limit: 2 Seconds      Memory Limit: 65536 KBOne day, Peter came across a function which looks like:F(1, X) = X mod A1.F(i, X) = F(i - 1, X) mod Ai, 2 ≤ i ≤ N.Where A is an integer arr...

2018-04-25 20:53:27 358

原创 HDU 3416 Marriage Match IV(最短路+最大流)

Marriage Match IVTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5008    Accepted Submission(s): 1498Problem DescriptionDo not sincere non-inter...

2018-04-23 19:45:18 260

原创 HDU 3667 Transportation(最小费用流 拆边)

TransportationTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3269    Accepted Submission(s): 1403Problem DescriptionThere are N cities, and M d...

2018-04-23 17:00:54 201

原创 HDU 3572 Task Schedule

Task ScheduleTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11046    Accepted Submission(s): 3363Problem DescriptionOur geometry princess XMM h...

2018-04-23 09:07:39 161

原创 HDU 6026 Deleting Edges(DAG)

Deleting EdgesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1188    Accepted Submission(s): 420Problem DescriptionLittle Q is crazy about gr...

2018-04-22 20:52:51 241

原创 “今日头条杯”首届湖北省大学程序设计竞赛(网络同步赛)(树形dp)

链接:https://www.nowcoder.com/acm/contest/104/C来源:牛客网题目描述 由于系统限制,C题无法在此评测,此题为现场赛的D题 Who killed Cock Robin? I, said the Sparrow, With my bow and arrow,I killed Cock Robin. Who saw ...

2018-04-22 20:42:48 453

原创 江西财经大学第一届程序设计竞赛 H-小P的数学问题

链接:https://www.nowcoder.com/acm/contest/115/H来源:牛客网题目描述 晚上,小P喜欢在寝室里一个个静静的学习或者思考,享受自由自在的单身生活。 他总是能从所学的知识散发出奇妙的思维。 今天他想到了一个简单的阶乘问题, 0!= 1 1!= 1 2!= 1 * 2 = 2 3!= 1 * 2 * 3 = 6 4!= ...

2018-04-22 09:59:05 398

原创 西安电子科技大学第16届程序设计竞赛网络同步赛 F-Operating System(贪心)

链接:https://www.nowcoder.com/acm/contest/107/F来源:牛客网题目描述在学习Operating System的过程中,Glory遇到了这样一个问题,现在有一个大小为可以容纳N个页面的内存,硬盘内的内容被分成M个页面,用1~M来标识,一开始内存里没有任何页面,接下来用户会请求Q个页面,你需要设计一个置换算法,使得缺页发生的次数最少。缺页是指

2018-04-22 09:54:42 763 1

原创 西安电子科技大学第16届程序设计竞赛网络同步赛 G-小国的复仇

链接:https://www.nowcoder.com/acm/contest/107/G来源:牛客网题目描述 众所周知,汀老师是XDUACM实验室最优秀的人,无论是学习还是打游戏。今天他突然想到一个好玩的游戏。规则是这样的,在游戏中他要得到n个小国,初始的时候小国和小杰各有1个。经过了很久的修炼,汀老师学会了两种魔法,他每次可以动用自己的智慧来使用魔法。 第一个魔法:(小杰变小国)可以将...

2018-04-21 20:16:57 462

原创 西安电子科技大学第16届程序设计竞赛网络同步赛 E-

链接:https://www.nowcoder.com/acm/contest/107/E来源:牛客网题目描述众所周知,Xieldy最常用的口令是******。 为了改变这一现状,他random了一个01串,并从中截取了一段作为自己的口令。 他选择的口令满足以下条件: 1. 口令串表示的二进制数在十进制下可以被表示为3k(k>=0)。 2. 口令串可以有前导零。 现已经random出了01串...

2018-04-21 20:11:55 403

原创 HDU 3046 Pleasant sheep and big big wolf (最小割)

Pleasant sheep and big big wolfTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3142    Accepted Submission(s): 1297Problem DescriptionIn ZJNU, t...

2018-04-21 11:22:59 256

原创 codeforce 510D Fox And Jumping

D. Fox And Jumpingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a game. In this game there is an infinite long tape with cel...

2018-04-20 14:20:16 256

原创 codeforce 507E Breaking Good

E. Breaking Goodtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBreaking Good is a new video game which a lot of gamers want to have. There is a c...

2018-04-20 11:06:21 205

原创 codeforce 510C Fox And Names(拓扑排序)

C. Fox And Namestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pro...

2018-04-20 10:26:56 158

原创 codeforce-507D The Maths Lecture(数位dp)

D. The Maths Lecturetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAmr doesn't like Maths as he finds it really boring, so he usually sleeps in Ma...

2018-04-20 10:21:02 252

原创 HDU 1569 方格取数(2)(最大独立集)

方格取数(2)Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7065    Accepted Submission(s): 2265Problem Description给你一个m*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干...

2018-04-19 11:56:16 303

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 J-小Y写文章(二分+二分图匹配)

链接:https://www.nowcoder.com/acm/contest/91/J来源:牛客网题目描述 小Y写了一篇文章,他对自己的文笔很有自信,尤其是自己总结出了一套计算文章通顺性的公式。 文章共N段,对于文章的每一段小Y对它都能计算出一个估值,而一篇文章的不连贯值定义为,现在小Y想要发布他的文章,但是编辑小Z让他加入一些广告,具体来说就是M段估值分别为的新段落。小Y很头疼,想让...

2018-04-18 10:27:07 388

原创 ZOJ 3805 Machine(dfs)

MachineTime Limit: 2 Seconds      Memory Limit: 65536 KBIn a typical assembly line, machines are connected one by one. The first machine's output product will be the second machine's raw material. To ...

2018-04-17 22:57:31 215

原创 POJ 3041 Asteroids(二分图匹配)

AsteroidsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 25136 Accepted: 13579DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N gr...

2018-04-17 11:26:32 195

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 B-合约数(dfs序)

链接:https://www.nowcoder.com/acm/contest/91/B来源:牛客网题目描述 在埃森哲,员工培训是最看重的内容,最近一年,我们投入了 9.41 亿美元用于员工培训和职业发展。截至 2018 财年末,我们会在全球范围内设立 100 所互联课堂,将互动科技与创新内容有机结合起来。按岗培训,按需定制,随时随地,本土化,区域化,虚拟化的培训会让你快速取得成长。小埃希望能通...

2018-04-16 11:57:42 239

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 C-序列变换

链接:https://www.nowcoder.com/acm/contest/91/C来源:牛客网题目描述 给定两个长度为n的序列,ai, bi(1<=i<=n), 通过3种魔法使得序列a变换为序列b,也就是ai=bi(1<=i<=n).   魔法1: 交换ai和aj,i!=j 首先通过若干次的魔法1将序列a变换成序列c   魔法...

2018-04-16 10:16:22 294

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 L-K序列

链接:https://www.nowcoder.com/acm/contest/91/L来源:牛客网题目描述给一个数组 a,长度为 n,若某个子序列中的和为 K 的倍数,那么这个序列被称为“K 序列”。现在要你 对数组 a 求出最长的子序列的长度,满足这个序列是 K 序列。 输入描述:第一行为两个整数 n, K, 以空格分隔,第二行为 n 个整数,表示 a[1] ∼ a[n],1 ≤ n ≤ 10...

2018-04-15 21:04:48 238 1

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 I-二数

链接:https://www.nowcoder.com/acm/contest/91/I来源:牛客网题目描述 我们把十进制下每一位都是偶数的数字叫做“二数”。 小埃表示自己很聪明,最近他不仅能够从小数到大:2,3,4,5....,也学会了从大数到小:100,99,98...,他想知道从一个数开始数最少的数就得到一个二数。但是聪明的小森已经偷偷在心里算好了小埃会数到哪个二数,请你求出他要数到...

2018-04-15 16:55:02 280

原创 埃森哲杯第十六届上海大学程序设计联赛春季赛暨上海高校金马五校赛 F-1+2=3?

链接:https://www.nowcoder.com/acm/contest/91/F来源:牛客网题目描述 小Y在研究数字的时候,发现了一个神奇的等式方程,他屈指算了一下有很多正整数x满足这个等式,比如1和2,现在问题来了,他想知道从小到大第N个满足这个等式的正整数,请你用程序帮他计算一下。 (表示按位异或运算) 输入描述:第一行是一个正整数,表示查询次数。接着有T行,每行有一个正整...

2018-04-15 16:46:44 488

原创 2018年长沙理工大学第十三届程序设计竞赛 D-zzq的离散数学

链接:https://www.nowcoder.com/acm/contest/96/D来源:牛客网题目描述     离散数学中有种名叫“哈斯图”的东西。     在这题中,你们需要计算的是一些正整数在偏序关系“整除”下的哈斯图的边数。用大白话讲,在偏序关系“整除”下的哈斯图,就是把一个个正整数看成一个个图的节点,某些节点之间有边。连边的规则是这样的:对于任意两个正整数a和b(a<b...

2018-04-14 20:11:28 388

原创 2018年长沙理工大学第十三届程序设计竞赛 H-数学考试

链接:https://www.nowcoder.com/acm/contest/96/H来源:牛客网题目描述今天qwb要参加一个数学考试,这套试卷一共有n道题,每道题qwb能获得的分数为ai,qwb并不打算把这些题全做完, 他想选总共2k道题来做,并且期望他能获得的分数尽可能的大,他准备选2个不连续的长度为k的区间, 即[L,L+1,L+2,....,L+k-1],[R,R+1,R+2,...,R...

2018-04-14 20:05:38 420

空空如也

空空如也

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

TA关注的人

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