上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 98 下一页
摘要: For some fixed N, an array A is beautiful if it is a permutation of the integers 1, 2, ..., N, such that: For every i < j, there is no k with i < k < 阅读全文
posted @ 2019-01-31 22:37 Veritas_des_Liberty 阅读(256) 评论(0) 推荐(0)
摘要: We are given S, a length n string of characters from the set {'D', 'I'}. (These letters stand for "decreasing" and "increasing".) A valid permutation  阅读全文
posted @ 2019-01-30 23:43 Veritas_des_Liberty 阅读(394) 评论(0) 推荐(0)
摘要: In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to s 阅读全文
posted @ 2019-01-30 23:04 Veritas_des_Liberty 阅读(365) 评论(0) 推荐(0)
摘要: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2019-01-30 22:09 Veritas_des_Liberty 阅读(168) 评论(0) 推荐(0)
摘要: 描述 写一个程序完成以下命令:new id ——新建一个指定编号为id的序列(id<10000)add id num——向编号为id的序列加入整数nummerge id1 id2——合并序列id1和id2中的数,并将id2清空unique id——去掉序列id中重复的元素out id ——从小到大输 阅读全文
posted @ 2019-01-29 23:35 Veritas_des_Liberty 阅读(607) 评论(0) 推荐(0)
摘要: 描述 下面的程序输出结果是: 1 2 6 7 8 9 请填空: 输入无输出1 2 6 7 8 9样例输入 样例输出 Approach #1: Analysis: 看到头文件中有set,很自然地就想到了用set来做这道题。刚开始想的是用set<int> v(a, a+7)来初始化set,但是这种方法, 阅读全文
posted @ 2019-01-29 23:33 Veritas_des_Liberty 阅读(379) 评论(0) 推荐(0)
摘要: greater 的应用 list 有两个sort成员函数  void sort(); 将list中的元素按 “<” 规定的比较方法升序排列。  template void sort (Compare op); 将list中的元素按 op 规定的比较方法升序排列。即要比较x,y 大小时,看 op( 阅读全文
posted @ 2019-01-29 21:26 Veritas_des_Liberty 阅读(247) 评论(0) 推荐(0)
摘要: STL中“大”“小” 的概念: 关联容器内部的元素是从小到大排序的 有些算法要求其操作的区间是从小到大排序的,称为“有序区间算法”例:binary_search 有些算法会对区间进行从小到大排序,称为“排序算法”例: sort 还有一些其他算法会用到“大”,“小”的概念使用STL时,在缺省的 阅读全文
posted @ 2019-01-29 19:16 Veritas_des_Liberty 阅读(260) 评论(0) 推荐(0)
摘要: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th 阅读全文
posted @ 2019-01-28 19:23 Veritas_des_Liberty 阅读(169) 评论(0) 推荐(0)
摘要: Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d 阅读全文
posted @ 2019-01-28 18:27 Veritas_des_Liberty 阅读(156) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 98 下一页