STL
文章平均质量分 54
无
wowon~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
天梯赛--L2-037 包装机 (25 分)
一种自动包装机的结构如图 1 所示。首先机器中有N条轨道,放置了一些物品。轨道下面有一个筐。当某条轨道的按钮被按下时,活塞向左推动,将轨道尽头的一件物品推落筐中。当 0 号按钮被按下时,机械手将抓取筐顶部的一件物品,放到流水线上。图 2 显示了顺序按下按钮 3、2、3、0、1、2、0 后包装机的状态。图1 自动包装机的结构图 2 顺序按下按钮 3、2、3、0、1、2、0 后包装机的状态一种特殊情况是,因为筐的容量是有限的,当筐已经满了,但仍然有某条轨道的按钮被按下时,系统应强制启动 ..原创 2022-04-15 14:46:51 · 306 阅读 · 0 评论 -
问题 F: Turing equation(string)
题目描述The fight goes on, whether to storenumbers starting with their most significant digit or their leastsignificant digit. Sometimesthisis also calledthe"Endian War". The battlegrounddates far back into the early days of computerscience....原创 2021-05-10 21:33:14 · 125 阅读 · 0 评论 -
Power Strings
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = "".原创 2021-07-19 19:28:17 · 102 阅读 · 0 评论 -
计蒜客--程序设计:后缀字符串(map)
#include<bits/stdc++.h>using namespace std;map<long long ,long long >ma;string s;long long a[100010];int main(){ int n; cin>>n; for(int i=0;i<n;i++) { cin>>s; long long x1=0,x2=1; for(int i=s.size()-1;i>=0;...原创 2022-03-18 16:10:31 · 236 阅读 · 0 评论 -
vector的基本操作(STL)
vector 是C++ STL的一个重要成员C++中的一种数据结构,它相当于一个动态的数组,当程序员无法知道自己需要的数组的规模多大时,用其来解决问题可以达到最大节约空间的目的.(1).在vector末尾添加一个元素(2).将vector末尾元素去掉(3).清空vector元素(4).对vector元素排序(5).vector元素反转(6).访问vector元素的方式(7). 在vector中间插入元素(8).vector长度(9).在任意位置插入元素.原创 2021-11-05 22:49:17 · 2763 阅读 · 0 评论 -
Registration system(map)
A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registra.原创 2021-08-20 10:25:11 · 114 阅读 · 0 评论 -
Misha and Changing Handles(map)
Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to any handle that is already used or that was used at some point.Mi.原创 2021-08-20 10:20:15 · 193 阅读 · 0 评论 -
输出最高分数的学生姓名(string)
输入学生的人数,然后再输入每位学生的分数和姓名,求获得最高分数的学生的姓名。输入格式第一行输入一个正整数N(N≤100)N(N≤100),表示学生人数。接着输入NN行,每行格式如下:分数 姓名分数是一个非负整数,且小于等于100100;姓名为一个连续的字符串,中间没有空格,长度不超过2020。数据保证最高分只有一位同学。输出格式获得最高分数同学的姓名。Sample Input587 lilei99 hanmeimei97 lily96 lucy7...原创 2021-08-20 10:03:23 · 662 阅读 · 1 评论 -
学生成绩查找系统⭐⭐⭐
学生成绩查找系统(map用法)学生成绩查找系统是一个根据姓名查找学生成绩的系统。系统可以录入是学生的姓名和成绩,录完之后可以输入查找条件,即学生的姓名,查找该生的成绩,如果存在该生的信息,则输出该生成绩,否则给出查无此人的提示信息。输入:题目输入包括录入学生信息和输入查找条件以及输入结束标志。insert语句表示录入学生信息,格式为字符insert+空格+字符串+空格+数字+换行符 ,例如 insert xiaohua 99 ,表示录入姓名为xiaohua的学生,其成绩为99 。 find语句表.原创 2021-03-02 23:09:49 · 1587 阅读 · 4 评论 -
Rank List(map)
Li Ming is a good student. He always asks the teacher about his rank in his class after every exam, which makes the teacher very tired. So the teacher gives him the scores of all the student in his class and asked him to get his rank by himself. However, .原创 2021-08-20 09:58:52 · 199 阅读 · 0 评论 -
H - 士兵队列训练问题
某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人数不超过三人为止。Input本题有多个测试数据组,第一行为组数N,接着为N行新兵人数,新兵人数不超过5000。Output共有N行,分别对应输入的新兵人数,每行输出剩下的新兵最初的编号,编号之间.原创 2021-07-13 09:48:17 · 339 阅读 · 0 评论 -
G - Text Reverse
Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them.InputThe input contains several test cases. The first line of the input is a single integer T.原创 2021-07-13 09:45:43 · 125 阅读 · 0 评论 -
D - 愚人节的礼物
四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。Input本题目包含多组测试,请处理到文件结束。每组测试包含一个长度不大于1000,只包含'(',')'和'B'三种字符的字符串,代表Vayko设计的礼物透视图。你可.原创 2021-07-13 09:41:11 · 163 阅读 · 0 评论 -
Bad Hair Day(单调栈)
Some of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top of other cows' heads.Each cowihas a specified heighth...原创 2021-07-13 10:26:34 · 189 阅读 · 0 评论 -
Largest Rectangle in a Histogram(模拟队列)
Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rect...原创 2021-08-19 10:42:22 · 144 阅读 · 0 评论 -
统计难题(map)
统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 262140/131070 K (Java/Others)Total Submission(s): 82214Accepted Submission(s): 29081Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的...原创 2021-08-18 12:25:00 · 211 阅读 · 0 评论 -
Babelfish(map)
Babelfish Time Limit:3000MS Memory Limit:65536K Total Submissions:62712 Accepted:25464 Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dial...原创 2021-08-19 10:59:47 · 178 阅读 · 0 评论 -
Let 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 count the balloons of each color and find the result.This.原创 2021-08-18 11:42:21 · 362 阅读 · 0 评论 -
Hat’s Words(map,string)
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the hat’s words in a dictionary.InputStandard input consists of a number of lowercase words, one per line, in alphabet.原创 2021-08-18 11:28:46 · 143 阅读 · 0 评论 -
Compound Words(set)
题目描述给出一个词典,找出所有的复合词,即恰好有两个单词连接而成的单词。输入每行都是一个小写字母组成的单词。输入已按照字典序从小到大排序,且不超过120000个单词。输出所有复合词,按照字典序从小到大排序。输入输出样例输入aalienbornlesslienneverneverthelessnewnewbornthezebra1234567891011输出aliennewborn主要是调用了substr函数,set里面的count函数。...原创 2021-08-17 20:39:07 · 141 阅读 · 0 评论 -
Throwing cards away I(queue)
Given is an ordered deck of n 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 away the top card and move the card that is now on the top.原创 2021-08-17 20:14:57 · 134 阅读 · 0 评论 -
Ugly Numbers(set)
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is included. Write a program to find and print the 1500’th ugly number.InputThere i.原创 2021-08-17 15:54:00 · 163 阅读 · 0 评论 -
看病要排队(优先队列)
看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。现在就请你帮助医院模拟这个看病过程。Input输入数据包含多组测试,请处理到文.原创 2021-08-17 15:40:17 · 235 阅读 · 0 评论 -
{A} + {B}(sort)
给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并后的集合,要求从小到大输出,每个元素之间有一个空格隔开.Sample Input1 212 31 211 2Sample O.原创 2021-08-17 15:20:34 · 137 阅读 · 0 评论 -
Ignatius and the Princess IV(sort)
"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to tell me which integer is the special one after I tell you .原创 2021-08-17 15:10:33 · 180 阅读 · 0 评论
分享