- 博客(98)
- 收藏
- 关注
原创 aaaa
mergeSQL> create table xs1 as select * from xs; Table created SQL> truncate xs1; truncate xs1 ORA-03290: 无效的截断命令 - 缺失 CLUSTER 或 TABLE 关键字 SQL> truncated table xs1; truncated tab...
2019-02-28 17:36:27 551
原创 HDOJ3374 String Problem next数组+最小最大表示法
Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings:String RankSKYLONG 1KYLONGS 2YLONGSK 3...
2019-02-27 20:52:32 141
原创 POJ 1961 next数组求所有存在循环节的前缀长度
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 ...
2019-02-27 20:37:23 259
原创 HDU 1686 Oulipo KMP求一个串在另一个串中出现的次数
The 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, mais tout s’...
2019-02-27 20:27:52 191
原创 next数组求所有可能的循环节长度
For each prefix with length P of a given string S,ifS[i]=S[i+P] for i in [0..SIZE(S)-p-1],then the prefix is a “period” of S. We want to all the periodic prefixs.InputInput contains multiple c...
2019-02-27 20:25:27 230
原创 Manacher 求回文字符串
Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, "Can you propose an efficient algorithm to find the length of the lar...
2019-02-27 19:56:40 119
原创 HDU 3294 Girls' research Manacher 求最长回文串起始位置及长度
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower case) ...
2019-02-27 17:59:39 176
原创 吉哥系列故事――完美队形II Manacher's变式
吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右对称,假设有m个人形成新的队形,则第1个人和第m个人身高相同,第2个人和第m-1个人...
2019-02-27 16:07:17 112
原创 字符串最小表示法+map统计个数 JAVA C++写法
Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces a...
2019-02-27 12:36:44 246
原创 next数组 + 最小最大表示
Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings: String Rank SKYLONG 1 KYLONGS 2 YLONGSK 3 ...
2019-02-27 09:14:03 199
原创 next数组
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-...
2019-02-26 21:59:42 586
原创 next数组与最短循环节
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 ...
2019-02-26 16:44:10 236
原创 关于next数组的一个例题
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example: s: "abab...
2019-02-26 16:14:33 1127
原创 判断名次 拓扑排序+并查集
自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP从高到低来排。 终于,Lele要开始行动了,对...
2019-02-24 23:31:34 211 1
原创 欧拉通路 字典树标号+并查集
You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch a...
2019-02-24 23:25:30 168
原创 寒假训练小结
感觉这个寒假还是很有收获的吧。首先是图论有比较大的进步,进一步了解了图论中的各种应用,熟悉了很多常见的用法。还是要自己动手写一下代码,不能说是单纯靠模板来写题,只有自己动手写,印象才会更加深刻。遇见题要多想一下思路,遇见相同类型的题要及时总结一下才好。对于数据结构来说,线段树和树状数组还要多继续补一下才行,春节期间又一次补了以前的三个专题,我感觉还要继续回顾一下,不复习就没有长进。...
2019-02-24 23:09:27 107
原创 找距离某个数最近的数 二分查找
链接:https://ac.nowcoder.com/acm/contest/372/B来源:牛客网 题目描述某天,一只可爱的小兔砸在路上蹦蹦跳跳地走着,怪人PM6出现了,于是小兔子被盯上了。PM6:“免子。哦不,小兔子。你长得真好…不对,真可爱。我这里有一道很容易很容易的题目,答对了我就请你吃萝卜,答错了你就请我吃兔肉,好不好呀~~?”小兔砸:“萝卜!?好呀好呀好呀。”于是笨...
2019-02-24 16:48:46 1118
原创 非联通图 拓扑排序求值
andelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards. The workers will c...
2019-02-24 15:17:46 640
原创 拓扑排序 确定排名
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表...
2019-02-24 14:18:31 206
原创 有向图欧拉通路
Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impo...
2019-02-24 11:19:15 622
原创 一个图至少几笔画可以画出
Ant Country consist of N towns.There are M roads connecting the towns. Ant Tony,together with his friends,wants to go through every part of the country. They intend to visit every road , and every r...
2019-02-24 10:48:40 780
原创 拓扑排序例题
Windy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N in such a way that:No two balls share the same label. The labeling satisfies several constrains ...
2019-02-23 22:34:17 629
原创 拓扑排序的一点解释
对于下面的图和代码:先找到初始的时候入度为0的节点 1 3 进入队列然后找与之相连的节点,看它的入度数是否为1,因为入队的点要删除,所有它相连入度数为1的点也要进队不断这样,最后看一下进队的和所有的点是否相同,相同可以拓扑排序当然拓扑排序还有很多用法 等我会了再更新一下吧#include<cstdio>#include<cstring>#inc...
2019-02-23 10:59:13 158
原创 寒假训练总结
今天主要是学习了强连通分量,了解到了其缩点和最短路的结合。缩点和重新建图很重要,感觉用到的地方很多,还有双联通分量也很重要,明天再回顾一下。...
2019-02-22 23:01:59 73
原创 带权并查集 离散化思想 并查集路径方向
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n...
2019-02-20 21:53:02 146
原创 并查集 逆向思考
In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages. However, when the Galaxy War began, some tunnels were destro...
2019-02-20 20:48:57 202
原创 贪心 || 贪心+并查集
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the s...
2019-02-20 17:38:21 228
原创 字典树 增删查改变式
度熊手上有一本神奇的字典,你可以在它里面做如下三个操作: 1、insert : 往神奇字典中插入一个单词 2、delete: 在神奇字典中删除所有前缀等于给定字符串的单词 3、search: 查询是否在神奇字典中有一个字符串的前缀等于给定的字符串 Input这里仅有一组测试数据。第一行输入一个正整数N(1≤N≤100000)N(1≤N≤100000),代表度熊对于字典的操...
2019-02-20 17:27:57 212
原创 并查集 JAVA
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...
2019-02-20 10:40:23 283
原创 并查集 JAVA
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n...
2019-02-20 10:39:05 273
原创 寒假训练总结
明天就是十五啦,第一个不在家的十五啊。晚上看了一下蓝桥杯的题目,题目好像大多数是填空题,做了做前几个,手动推一下公式或者就模拟一下就可以做出来了。听说搜索用处很大,后面的三道编程题好像基本用不到算法,优化一下模拟就行了,关键是有那个想法吧。明天早点起下,做点带权并查集类似的题目,巩固一下,最近代码用java写一下。...
2019-02-18 23:31:42 73
原创 带权并查集
N children are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty). You don’t kn...
2019-02-18 21:16:40 97
原创 hdu 5806 乘法原理 || 尺取法 || 二分法
DescriptionNanoApe, the Retired Dog, has returned back to prepare for for the National Higher Education Entrance Examination!In math class, NanoApe picked up sequences once again. He wrote down a ...
2019-02-17 23:04:37 147
原创 寒假训练总结
体会到尺取法的巧妙了,以前好像接触过这种思维,比朴素的思想强多了,还要注意它和其他算法的结合。二分也很重要,要仔细体会二分出答案,注意保留的是哪个值,如果是实数的话可以转化为整数,最后再转化回去,这样在中间过程就不需要注意精度了,否则很容易错啊。树状数组和线段树还要继续努力,多体会一下代码,见识一下更多的题型。...
2019-02-17 21:50:27 78
原创 POJ 2566 尺取法+前缀和排序
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, no...
2019-02-17 21:47:10 148
原创 数据库练习题题解作业
期末考试大题题型:1、 需要将学校中的系、教员、课程,以及他们之间的联系组织到关系数据库中,对于每个系需要存储的信息有系号、系名、系主任;对于每个教员,需要存储的信息有职工号、姓名、专长;对于每门课程,需要存储的信息有课程号、课程名、学分。有关的联系是:每个系有若干名教员,开设若干门课程;每位教员只在一个系工作;每门课程只由一个系开设,每位教员可讲授多门课程;每门课程可由多位教员讲授;课...
2019-02-17 18:43:03 6251
原创 POJ 1064 二分+小数转化整数控制精度 错了n次
http://poj.org/problem?id=1064DescriptionInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the m...
2019-02-17 17:55:41 187
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人