STL
十二分热爱
这个作者很懒,什么都没留下…
展开
-
Winner(Map运用)
The winner of the card game popular in Berland "Berlogging" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is ...原创 2018-07-29 18:43:18 · 533 阅读 · 0 评论 -
Web Navigation(stack栈的运用)
Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be re...原创 2018-08-01 10:58:24 · 436 阅读 · 0 评论 -
愚人节的礼物(stack栈的运用)
四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。 用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。 Input本题目包含多组测试,请处理到文件结束。 每组...原创 2018-08-01 10:12:22 · 237 阅读 · 0 评论 -
the kth great num(priority_queue优先队列)
Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming ...原创 2018-07-31 19:54:11 · 111 阅读 · 0 评论 -
STL
1.MapMap是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的。...转载 2018-07-31 18:22:32 · 71 阅读 · 0 评论 -
STL优先队列最小堆最大堆
struct Node{ int u,dis; bool operator< (const struct Node& b) const { return dis>b.dis;//以dis为关键字的最小堆 }};struct Node{ int u,dis; bool operator< (const struct Node& b) con...原创 2018-08-05 11:07:19 · 1351 阅读 · 0 评论 -
Andy First Dictionary(Set运用)(java实现)
题目链接:Andy First Dictionaryimport java.util.Scanner;import java.util.Set;import java.util.TreeSet;import java.util.regex.Matcher;import java.util.regex.Pattern;public class Main { public sta...原创 2018-07-30 21:33:51 · 210 阅读 · 0 评论 -
Hdu1412A+B(Set运用)(java实现)
给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并后的集合,要求从小到大输出,每个元素...原创 2018-07-30 21:12:17 · 258 阅读 · 0 评论 -
百度之星资格赛(Map运用)
度熊所居住的 D 国,是一个完全尊重人权的国度。以至于这个国家的所有人命名自己的名字都非常奇怪。一个人的名字由若干个字符组成,同样的,这些字符的全排列的结果中的每一个字符串,也都是这个人的名字。例如,如果一个人名字是 ACM,那么 AMC, CAM, MAC, MCA, 等也都是这个人的名字。在这个国家中,没有两个名字相同的人。 度熊想统计这个国家的人口数量,请帮助度熊设计一个程序,用来统计每一...原创 2018-07-29 22:18:05 · 104 阅读 · 0 评论 -
the balloon rise(Map运用)
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will cou...原创 2018-07-29 18:46:12 · 113 阅读 · 0 评论 -
Throwing cards away I(queue循环队列)
Given is an ordered deck ofn cards numbered 1 to n with card 1 at the top and card n at the bottom. The following operation is performed as long as there are at least two cards in the deck:Throw awa...原创 2018-08-01 13:21:54 · 271 阅读 · 0 评论