作者: 阮一峰 日期: 2011年4月 4日 日本程序员norahiko,写了一个排序算法的动画演示,非常有趣。 这个周末,我就用它当做教材,好好学习了一下各种排序算法。 排序算法(Sorting algorithm)是计算机科学最古老、最基本的课题之一。要想成为合格的程序员,就必须理解和掌握各种排 ...
分类:
编程语言 时间:
2017-11-07 14:20:16
阅读次数:
128
欢迎访问~原文出处——博客园-zhouzhendong 去博客园看该题解 题目传送门 - POJ2891 题意概括 给出k个同余方程组:x mod ai = ri。求x的最小正值。如果不存在这样的x,那么输出-1.不满足所有的ai互质。 题解 互质就简单,但是不互质就有些麻烦,到现在我还是不大懂。 ...
分类:
其他好文 时间:
2017-11-06 22:59:30
阅读次数:
217
Stack & Queue Implementations Basic Sorting Algorithm Implementations package cn.edu.tsinghua.stat.mid_term; /** * Created by shuaiyi on 04/11/2017. * ...
分类:
编程语言 时间:
2017-11-05 16:33:37
阅读次数:
152
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key ...
分类:
其他好文 时间:
2017-11-05 10:19:24
阅读次数:
164
Description Solution 比赛时找到了规律,但是没有证出来……(当然最后还是AC了……) 显然没有被操作的数在排好序的序列中一定是连续的一段。 所以,没有被操作的数一定从左到右连续地递增(例如23456)。 而题目要求被操作的数尽量少,就是没有被操作的数尽可能多,找到满足条件的最长的 ...
分类:
编程语言 时间:
2017-10-29 12:51:42
阅读次数:
124
Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arres ...
分类:
其他好文 时间:
2017-10-28 23:49:28
阅读次数:
177
题目: Strange Game On Matrix Ivan is playing a strange game. He has a matrix a with n rows and m columns. Each element of the matrix is equal to either ...
分类:
其他好文 时间:
2017-10-25 21:46:51
阅读次数:
199
Description An infinitely long railway has a train consisting of n cars, numbered from 1 to n (the numbers of all the cars are distinct) and positione ...
分类:
其他好文 时间:
2017-10-25 21:26:18
阅读次数:
138
题目链接:http://codeforces.com/problemset/problem/875/B 题意:一开始给定n个不流通的硬币,每次增加让其中一个硬币流通,流通的硬币的下一个如果不流通,那么就交换两个硬币。 直到两个流通的硬币在一起,或者两个不流通的硬币在一起,那就不用交换了。初始观察次数 ...
分类:
其他好文 时间:
2017-10-25 19:56:05
阅读次数:
186
A - BalancePOJ1837 Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.It orders ...
分类:
其他好文 时间:
2017-10-24 01:44:03
阅读次数:
333