stl
njupt_wrj
这个作者很懒,什么都没留下…
展开
-
PTA 7-9 集合相似度(STL之set初体验)
7-9 集合相似度(25 分)给定两个整数集合,它们的相似度定义为:Nc/Nt×100%。其中Nc是两个集合都有的不相等整数的个数,Nt是两个集合一共有的不相等整数的个数。你的任务就是计算任意一对给定集合的相似度。输入格式:输入第一行给出一个正整数N(≤50),是集合的个数。随后N行,每行对应一个集合。每个集合首先给出一个正整数M(≤104),是集合中元素的个数;然后...原创 2018-03-27 21:10:19 · 289 阅读 · 0 评论 -
PTA 7-10 树的遍历(二叉树基础、层序遍历、STL初体验之queue)
7-10 树的遍历(25 分)给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。输出格式:在一行中输出该树的层序遍历的序列。数字间以1个空格分隔,行首尾不得有多余空格。输入样例:7 2 3 1 5 7 6 4 1 ...原创 2018-03-28 12:50:39 · 541 阅读 · 0 评论 -
HDU 1004 Let the Balloon Rise(STL初体验之map)
Problem DescriptionContest 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 ...原创 2018-04-16 19:14:06 · 167 阅读 · 0 评论 -
Codevs 1205 单词反转(Vector以及如何输出string)
题意:倒序输出句子中的单词代码:#include<cstdio> #include<iostream> #include<string> #include<cmath> #include<cstring> #include<algorithm> #include<set> #include<queue原创 2018-05-17 18:47:43 · 205 阅读 · 0 评论 -
Codeforces 977B Two-gram(stl之string掉进坑)
Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" — three distinct two-grams.You are given a string ss consisting of nn capital Latin lett...原创 2018-05-12 16:08:01 · 252 阅读 · 0 评论