随笔分类 -  STL---set

摘要:如果两个整数各位数字的和是一样的,则被称为是“朋友数”,而那个公共的和就是它们的“朋友证号”。例如 123 和 51 就是朋友数,因为 1+2+3 = 5+1 = 6,而 6 就是它们的朋友证号。给定一些整数,要求你统计一下它们中有多少个不同的朋友证号。 输入格式: 输入第一行给出正整数 N。随后一 阅读全文
posted @ 2019-07-14 16:44 wydxry 阅读(263) 评论(0) 推荐(0) 编辑
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2019-07-09 11:10 wydxry 阅读(179) 评论(0) 推荐(0) 编辑
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <queue> 4 #include <set> 5 using namespace std; 6 int main() 7 { 8 //声明 9 set<int> s; 10 11 //插入元 阅读全文
posted @ 2018-12-30 19:51 wydxry 阅读(252) 评论(0) 推荐(0) 编辑
摘要:1.关于set C++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构操作。vector封装数组,list封装了链表,map和set封装了二叉树等,在封装这些数据结构的时 阅读全文
posted @ 2018-02-28 16:44 wydxry 阅读(1023) 评论(0) 推荐(0) 编辑

Live2D