- 博客(14)
- 收藏
- 关注
原创 组队赛——NO.1 (Accepted)
1、N-th Largest Value题目链接题意:找出倒数第三大数字CODE:#include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <cstdlib>#include <algorithm>...
2018-10-31 16:28:36 212
原创 用JAVA 实现卡特兰数
卡特兰数详解JAVA 实现大数 详解 例1:B - Game of ConnectionsThis is a small but ancient game. You are supposed to write down the numbers 1, 2, 3, ... , 2n - 1, 2n consecutively in clockwise order on the gr...
2018-10-23 13:03:59 1566 2
原创 几种排序知识讲解
一:几种排序方法排序算法的复杂度:ACM常用算法排序二、1、冒泡排序:冒泡排序是一种简单的排序算法,但是时间复杂度较大。它重复地走访过要排序的数列,一次比较两个元素,如果它们的顺序错误就把它们交换过来。走访数列的工作是重复地进行直到没有再需要交换,也就是说该数列已经排序完成。这个算法的名字由来是因为越小的元素会经由交换慢慢“浮”到数列的顶端。...
2018-10-16 20:23:12 758 1
原创 POJ3235Fence Repair( 优先队列 )
优先队列详解点这里D - Fence RepairDescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, e...
2018-10-11 20:58:34 311
转载 优先队列——Priority_queue 详解
转载大佬博客一、入门介绍1、优先队列是一种特殊的队列,这种队列会自动的把队列里的数排序(默认从大到小,使用“<”判断)而且还可以把数按照特定的方法排列!(包括结构体和重载"<")2、优先队列的头文件,需要包括:#include<queue>using namespace std;声明:一个优先队列声明的基本格式是: prior...
2018-10-11 20:58:11 626
原创 算法模板——KMP(字符串匹配)
看了算法书和博客,发现了next[] 可以有两种用法,不过kmp的算法思想都是一样的1、入门介绍什么是KMP算法:KMP算法要解决的问题就是在字符串(也叫主串)中的模式(pattern)定位问题。说简单点就是我们平时常说的关键字搜索。模式串就是关键字(接下来称它为P),如果它在一个主串(接下来称为T)中出现,就返回它的具体位置,否则返回-1(常用手段)。 首先,对于...
2018-10-10 18:43:48 406
原创 国庆个人赛——NO.7
1、Codeforces-716B Complete the WordZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where ea...
2018-10-08 20:37:40 237
原创 国庆个人赛——NO.6
1、Codeforces-714AToday an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya!Sonya is an owl and she sleeps during the day and stay awake from m...
2018-10-08 19:50:38 166
原创 国庆个人赛——NO.5
1、Codeforces-1060ALet's call a string a phone number if it has length 11 and fits the pattern "8xxxxxxxxxx", where each "x" is replaced by a digit.For example, "80123456789" and "80000000000" ar...
2018-10-06 11:23:20 286
原创 国庆个人赛——NO.4
1、Codeforces——1047ALittle C loves number «3» very much. He loves all things about it.Now he has a positive integer nn. He wants to split nn into 33 positive integers a,b,ca,b,c, such that a+b+c=...
2018-10-04 16:54:34 574
原创 国庆个人赛——NO.3
1、Codeforces——1042AThere are nn benches in the Berland Central park. It is known that aiai people are currently sitting on the ii-th bench. Another mm people are coming to the park and each of the...
2018-10-04 10:47:03 251
原创 国庆个人赛——NO.2
1、Codeforces——1038A( Equality )You are given a string ss of length nn, which consists only of the first kk letters of the Latin alphabet. All letters in string ss are uppercase.A subsequence of ...
2018-10-02 16:57:08 550
原创 国庆个人赛——NO.1
1、A - Turn the RectanglesThere are nn rectangles in a row. You can either turn each rectangle by 9090 degrees or leave it as it is. If you turn a rectangle, its width will be height, and its heig...
2018-10-01 16:15:19 246
原创 51nod 1001 数组中和等于K的数对 (二分法)
1001 数组中和等于K的数对给出一个整数K和一个无序数组A,A的元素为N个互不相同的整数,找出数组A中所有和等于K的数对。例如K = 8,数组A:{-1,6,5,3,4,2,9,0,8},所有和等于8的数对包括(-1,9),(0,8),(2,6),(3,5)。Input第1行:用空格隔开的2个数,K N,N为A数组的长度。(2 <= N <= 50000,-10^9 ...
2018-10-01 10:35:16 228
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人