题1.给定一个int数组,一个数sum,求数组中和为sum的任意2个数的组合 @Test public void test_find2() { int[] arr = { -1, 0, 2, 3, 4, 7, 8, 9, 10 }; int sum = 9; Arrays.sort(arr); List<TwoTuple<Integer, Integer>> result = new ArrayList<>(); int i = 0; int j = arr.lengt…
Description Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute, no matter how you rearrange their lett…
一:题目 就是输入一系列书本名和作者名,然后输入命令模拟借书和还书,再输出归还的书的摆放位置.要求有两点: 需要对归还的书做特殊排序处理:作者名相同,则书本按书名从小到大排序:否则书本按作者名大小排序 需要归还的书的位置前面没有书籍时,需要特殊处理 (一)样例输入 "The Canterbury Tales" by Chaucer, G. "Algorithms" by Sedgewick, R. "The C Programming Language&q…
一:题目 输入一系列由小写字母组成的单词.输入已按照字典序排序,且不超过120000个.找出所有的复合词,即恰好由两个单词连接而成的单词 (一)样例输入 a alien born less lien never nevertheless new newborn the zebra (二)样例输出 alien newborn 二:代码实现 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #in…
一:题目 对数据库中数据进行检测,是否出现数据冗余现象.即是否某一列出现两个及以上数据重复 如上图中,第二列中第2,3行数据重复,所以我们判断为数据冗余.因为他可以分解为下面两张表 (一)样例输入 How to compete in ACM ICPC,Peter,peter@neerc.ifmo.ru How to win ACM ICPC,Michael,michael@neerc.ifmo.ru Notes from ACM ICPC champion,Michael,michael@nee…