自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 【算法竞赛进阶指南】- 质数距离/prime distance - poj2689

题目描述给定两个整数L和U,你需要在闭区间[L,U]内找到距离最接近的两个相邻质数C1和C2(即C2-C1是最小的),如果存在相同距离的其他相邻质数对,则输出第一对。同时,你还需要找到距离最远的两个相邻质数D1和D2(即D1-D2是最大的),如果存在相同距离的其他相邻质数对,则输出第一对。输入格式每行输入两个整数L和U,其中L和U的差值不会超过1000000。输出格式对于...

2020-02-02 16:02:40 361

原创 CFGym 100956D - Greedy Game【贪心】【优先队列】( 2015-2016 Petrozavodsk Winter Training Camp)

题目:题目大意:给n个物品,每个物品对A和B的价值不同,A先手并且A每次选剩余物品中对于他最大的物品,问不管A怎么选(可能有多个物品对于A的价值相同,但会影响B的所得),B都能得到的最大价值是多少?(换句话说就是最坏情况下B所能得到的最大价值)(这题题意读错两次,第三次才理解对,第一次以为是最好情况,第二次以为不管A怎么选,B都有办法拿到相同的价值,再从中取最大值)题目分析:...

2019-10-03 22:58:41 290 1

原创 Codeforces Round #575 (Div. 3) - D2. RGB Substring (hard version)

原题链接The only difference between easy and hard versions is the size of the input.You are given a stringsconsisting ofnncharacters, each character is 'R', 'G' or 'B'.You are also given an int...

2019-07-25 21:17:21 171

原创 hdu3746 - Cyclic Nacklace(kmp- 最小循环元)

Problem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and ...

2019-07-25 18:50:43 179

原创 hdu2087 - 剪花布条(hash / kmp)

Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字...

2019-07-25 17:55:55 153

原创 hdu1686 - Oulipo (kmp / hash)

DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal,...

2019-07-25 17:25:31 177

原创 【codeforces - 1197D】- Yet Another Subarray Problem (dp)

题目链接You are given an arraya1,a2,…,an and two integersmandk.You can choose some subarrayal,al+1,…,ar−1,arThe cost of subarrayal,al+1,…,ar−1,ar is equal to, where⌈x⌉is the least integer g...

2019-07-24 20:09:00 585

原创 HDU4398 - Template Library Management(贪心 + STL)

Problem DescriptionAs an experienced ACMer, you must have known the importance of "code template library". With the help of pre-printed code library, you can implement the complicated algorithms cor...

2019-07-22 22:26:55 103

原创 【codeforces - 534D】 - Handshakes

原题链接DescriptionOn February, 30thnstudents came in the Center for Training Olympiad Programmers (CTOP) of the Berland State University. They came one by one, one after another. Each of them went...

2019-07-22 20:08:57 123

原创 uva11475 - Extend to Palindrome - hash / kmp

原题链接,进去比较慢DescriptionYour task is, given an integer N, to make a palindrome (word that reads the same when you reverse it) of length at least N (1 <= N <= 100,000). Any palindrome will do....

2019-07-22 19:20:05 150

原创 TIANKENG’s restaurant(Ⅱ) - hdu4886

TIANKENG’s restaurant(Ⅱ) Time Limit: 16000/8000 MS (Java/Others)Memory Limit: 130107/65536 K (Java/Others) Total Submission...

2019-07-19 11:11:50 246

原创 Number Sequence - hdu 1711

Number Sequence Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submi...

2019-07-18 22:06:37 93

原创 Codeforces Round #573 (Div. 2) - C. Tokitsukaze and Discard Items

C. Tokitsukaze and Discard ItemsRecently, Tokitsukaze found an interesting game. Tokitsukaze hadnnitems at the beginning of this game. However, she thought there were too many items, so now she wa...

2019-07-13 17:53:56 274

原创 牛客网 - 简单的数据结构

题目描述栗酱有一天在网上冲浪的时候发现了一道很有意思的数据结构题。该数据结构形如长条形。一开始该容器为空,有以下七种操作。1 a从前面插入元素a2 从前面删除一个元素3 a从后面插入一个元素4 从后面删除一个元素5 将整个容器头尾翻转6 输出个数和所有元素7 对所有元素进行从小到大排序输入描述:只有一组数据,第一行n≤50000,m≤200000,...

2019-07-11 20:51:13 669 1

原创 牛客网 - Number

题目描述We define Shuaishuai-Number as a number which isthe sum of a prime square(平方), prime cube(立方), and prime fourth power(四次方).The first four Shuaishuai numbers are:How many Shuaishuai number...

2019-07-10 23:26:51 658

原创 【算法竞赛进阶指南】- Sunscreen - poj3614

题目描述有C头奶牛进行日光浴,第i头奶牛需要minSPF[i]到maxSPF[i]单位强度之间的阳光。每头奶牛在日光浴前必须涂防晒霜,防晒霜有L种,涂上第i种之后,身体接收到的阳光强度就会稳定为SPF[i],第i种防晒霜有cover[i]瓶。求最多可以满足多少头奶牛进行日光浴。输入格式第一行输入整数C和L。接下来的C行,按次序每行输入一头牛的minSPF和maxSPF值,...

2019-07-09 15:55:55 1173

原创 【算法竞赛进阶指南】- 货仓选址 - CH0501

题目描述在一条数轴上有N家商店,它们的坐标分别为A1~AN。现在需要在数轴上建立一家货仓,每天清晨,从货仓到每家商店都要运送一车商品。为了提高效率,求把货仓建在何处,可以使得货仓到每家商店的距离之和最小。输入格式第一行输入整数N。第二行N个整数A1~AN。输出格式输出一个整数,表示距离之和的最小值。数据范围1≤N≤100000 1≤N≤10000...

2019-07-09 13:33:12 463

原创 【算法竞赛进阶指南】- Cinema - Codeforces 670C

题目描述:莫斯科正在举办一个大型国际会议,有n个来自不同国家的科学家参会。每个科学家都只懂得一种语言。为了方便起见,我们把世界上的所有语言用1到1e9之间的整数编号。在会议结束后,所有的科学家决定一起去看场电影放松一下。他们去的电影院里一共有m部电影正在上映,每部电影的语音和字幕都采用不同的语言。对于观影的科学家来说,如果能听懂电影的语音,他就会很开心;如果能看懂字幕,他...

2019-07-09 00:22:06 393

空空如也

空空如也

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

TA关注的人

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