STL
文章平均质量分 58
m0_61067261
这个作者很懒,什么都没留下…
展开
-
CF32B Borze(模拟+字符串)(大佬勿喷)
题目描述Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number given its原创 2021-10-16 17:55:00 · 365 阅读 · 4 评论 -
入门好题集(CodeForces)
洛谷:CF14A Letter题解CF16A Flag题解CF22A Second Order Statistics题解CF32B Borze题解原创 2021-10-31 16:36:47 · 313 阅读 · 0 评论 -
CF22A Second Order Statistics(字符串+哈希+桶排序 或STL中的set)
题目描述Once Bob needed to find the second order statistics of a sequence of integer numbers. Lets choose each number from the sequence exactly once and sort them. The value on the second position is the second order statistics of the given sequence. In ot..原创 2021-10-16 17:43:54 · 137 阅读 · 0 评论 -
CF16A Flag(模拟+字符串+暴力搜索)(大佬勿喷)
题目描述According to a new ISO standard, a flag of every country should have a chequered fieldn×mn×m, each square should be of one of 10 colours, and the flag should be «striped»: each horizontal row of the flag should contain squares of the same colour,...原创 2021-10-16 17:31:14 · 226 阅读 · 0 评论 -
CF14A Letter(模拟+字符串)(C++题解)(大佬勿喷)
题目描述A boy Bob likes to draw. Not long ago he bought a rectangular graph (checked) sheet withnnrows andmmcolumns. Bob shaded some of the squares on the sheet. Having seen his masterpiece, he decided to share it with his elder brother, who lives in Fla...原创 2021-10-16 17:14:59 · 383 阅读 · 0 评论 -
C++_STL_vector
1.vector的介绍STL中的一种容器,像stack,queue,map,set等2.vector的定义定义一个vector的方法如下vector<typename> name以上定义相当于定义了一个一维数组name [size] , 只是size不确定,可长可短,typename可以是各种数据类型,如int, char, double也可以这么定义:vector<int> a;vector<node> stu; // node原创 2021-10-16 14:02:49 · 143 阅读 · 0 评论 -
栈 C++详解(数据结构)
详解一像数组或链表一样,栈也是一种数据结构,它包含一系列元素。但是,与数组和链表不同的是,栈是一个后进先出(LIFO)的结构,这意味着当一个程序从栈中检索元素时,插入到栈中的最后一个元素是第一个被检索的元素(同样,插入的第一个元素是最后一个被检索的元素)。在想象一个栈的工作方式时,可以想象一下餐厅流水线开始时的一堆盘子。当餐厅的工作人员补充餐盘时,他或她放入的第一个盘子将是最后一个被取走的,如图 1 所示。图 1 栈的后进先出方式就像餐厅盘子的取用方式餐厅中一堆盘子的LIF.转载 2021-10-16 13:45:37 · 6013 阅读 · 1 评论 -
P1165 日志分析
题目描述M海运公司最近要对旗下仓库的货物进出情况进行统计。目前他们所拥有的唯一记录就是一个记录集装箱进出情况的日志。该日志记录了两类操作:第一类操作为集装箱入库操作,以及该次入库的集装箱重量;第二类操作为集装箱的出库操作。这些记录都严格按时间顺序排列。集装箱入库和出库的规则为先进后出,即每次出库操作出库的集装箱为当前在仓库里所有集装箱中最晚入库的集装箱。出于分析目的,分析人员在日志中随机插入了若干第三类操作――查询操作。分析日志时,每遇到一次查询操作,都要报告出当前仓库中最大集装箱的重量。输入.原创 2021-10-16 12:57:07 · 257 阅读 · 0 评论 -
#3. 复读机(LibreOJ)
题目描述输入一些正整数,将它们原样输出。提示这道题用于测试文件输入输出,请注意使用文件输入输出,而非标准输入输出。请将鼠标移至上方的文件 IO图标,查看输入输出文件名。输入格式第一行一个正整数,表示有组测试数据。接下来行,每行一个正整数。输出格式输出行,每行一个正整数。样例 1输入3123输出123样例 2输入11000000000000000000000000000000000输出复制100...原创 2021-10-10 10:15:27 · 904 阅读 · 1 评论 -
回文判断(c++)
题目描述输入一个数,输出是否为回文数输入一行一个整数输出是则输出1,反之输出0输入样例11001输出样例11输入样例2123输出样例20CODE(用STL储存各位数,使用先入后出的栈和先入先出的队列比较即可)#include<iostream>#include<stack>#include<queue>using namespace std;stack<int> s;queue<in原创 2021-08-21 15:55:47 · 130 阅读 · 0 评论