这题用string和cin会超时,所以要用char。 2个小知识点。 1.id用int类型,输出时用%06d输出 2.strcmp比较char类型字符串,若str1==str2,则返回零;若str1<str2,则返回负数;若str1>str2,则返回正数。 #include<iostream> #i ...
分类:
其他好文 时间:
2018-12-04 22:32:30
阅读次数:
153
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1119 https://www.lydsy.com/JudgeOnline/problem.php?id=1697 先找到置换的循环节。发现对于同一个循环节里的元素,可以找一个代价最小的元素,用 ...
分类:
编程语言 时间:
2018-12-03 20:18:53
阅读次数:
197
题目来源:http://codeforces.com/problemset/problem/55/D Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer num ...
分类:
其他好文 时间:
2018-12-03 19:54:00
阅读次数:
201
1,查找算法 常用的查找算法包括顺序查找,二分查找和哈希查找。 1.1 顺序查找(Sequential search) 顺序查找: 依次遍历列表中每一个元素,查看是否为目标元素。python实现代码如下: #无序列表 def sequentialSearch(alist,item): found = ...
分类:
编程语言 时间:
2018-12-02 19:16:19
阅读次数:
229
Sorting It All Out Time Limit: 1000MS Memory Limit: 10000K Total Submissions:39731 Accepted: 13975 Description An ascending sorted sequence of distinc ...
分类:
其他好文 时间:
2018-11-16 23:42:44
阅读次数:
298
Strange fuction Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10462 Accepted Submission(s): 699 ...
分类:
其他好文 时间:
2018-11-11 20:17:42
阅读次数:
122
github:https://github.com/bingmann/sound-of-sorting 排序之声 - “Audibilization”和排序算法的可视化:http://panthema.net/2013/sound-of-sorting/ 视频:https://www.bilibil ...
分类:
编程语言 时间:
2018-11-10 22:36:23
阅读次数:
259
MongoDB:管道操作 使用聚合框架可以对集合中的文档进行变换和组合。基本上,可以用多个构件创建一个管道(pipeline),用于对一连串的文档进行处理。这些构件包括筛选(filter)、投射(projecting)、分组(grouping)、排序(sorting)、限制(limiting)和跳过 ...
分类:
数据库 时间:
2018-11-07 16:38:57
阅读次数:
333
题意 有一个数x,x%ai = ri ,给出n对ai和ri,问x的最小非负整数是什么,如果不存在输出-1 分析 ai不互质的中国剩余定理 >扩展中国剩余定理 我已经放弃看懂证明了 直接上构造公式 代码 ...
分类:
其他好文 时间:
2018-11-05 22:26:47
阅读次数:
259