摘要: n boys and m girls came to the party. Each boy presented each girl some integer number of sweets (possibly zero). All boys are numbered with integers 阅读全文
posted @ 2020-04-07 23:52 LiangYC1021 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Let's call an array of non negative integers a1,a2,…,an a k extension for some non negative integer k if for all possible pairs of indices 1≤i,j≤n the 阅读全文
posted @ 2020-04-07 23:52 LiangYC1021 阅读(113) 评论(0) 推荐(0) 编辑
摘要: A. A pile of stones Vasya has a pile, that consists of some number of stones. n times he either took one stone from the pile or added one stone to the 阅读全文
posted @ 2020-04-07 23:51 LiangYC1021 阅读(173) 评论(0) 推荐(0) 编辑
摘要: A. Dreamoon and Ranking Collection Example: input 5 6 2 3 1 1 5 7 10 1 100 100 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 57 80 60 40 20 output: 5 101 2 2 60 阅读全文
posted @ 2020-04-06 01:03 LiangYC1021 阅读(228) 评论(0) 推荐(0) 编辑
摘要: STL 中栈的使用方法(stack) 头文件: 定义: stack栈名。 cf: 基本操作: push(x) 将x加入栈中,即入栈操作 pop() 出栈操作(删除栈顶),只是出栈,没有返回值 top() 返回第一个元素(栈顶元素) size() 返回栈中的元素个数 empty() 当栈为空时,返回  阅读全文
posted @ 2020-04-02 14:28 LiangYC1021 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 在本周作业中遇到了后缀表达式(逆波兰式)。一是将一般的中缀表达式转化为后缀表达式;二是后缀表达式的值的计算。 这两题我都用的是数组模拟栈来解决,查阅资料并不多, "百度百科:逆波兰式" 中的逆波兰式的概念、实现、举例我觉得都比csdn、博客园上的帖子详细而且好理解,所以主要是参考了百度百科。 题一: 阅读全文
posted @ 2020-03-27 19:56 LiangYC1021 阅读(732) 评论(0) 推荐(0) 编辑
摘要: 本周的作业里有一些题目要将数字转换为string类的字符串,于是学习了stringstream的用法,发现巨好用!! 于是记录学习一下。 头文件 该方法可以实现任意类型之间的转换,比如把要输入的类型定义为in_type,要转换成的类型定义为out_type,于是有: 举例: 数字转字符串的函数: 当 阅读全文
posted @ 2020-03-19 12:31 LiangYC1021 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 于2020/02/24记录。 德州扑克属实是个带难题。本题解简单易懂,命名合理,~~应该比较好理解~~。 题目如下: 最近,阿夸迷于德州扑克。所以她找到了很多人和她一起玩。由于人数众多,阿夸必须更改游戏规则: 所有扑克牌均只看数字,不计花色。 每张卡的值为1、2、3、4、5、6、7、8、9、10、1 阅读全文
posted @ 2020-02-24 16:42 LiangYC1021 阅读(577) 评论(2) 推荐(0) 编辑
摘要: |这个作业属于哪个课程| "班级的链接" | | | | |这个作业要求在哪里| "作业的要求" | |这个作业的目标|继续完成作业二的编程题。优化架构,思考代码的拓展性,比如我需要增加其他功能,如选择,循环语句怎么办。思考:可以参考现有的编程语言,把这些语言的内容加入。如选择、循环语句、函数、或者 阅读全文
posted @ 2020-02-16 16:50 LiangYC1021 阅读(174) 评论(0) 推荐(0) 编辑
摘要: |这个作业属于哪个课程| "我的班级" | | | | |这个作业要求在哪里| "作业要求" | |这个作业的目标|1继续完成编程题2新建一个github仓库,并把作业推送到该仓库3发布博客| |作业正文| "面向对象程序设计寒假作业2" "面向对象程序设计编程题完善1.0" | |其他参考文献| 阅读全文
posted @ 2020-02-05 14:45 LiangYC1021 阅读(180) 评论(0) 推荐(0) 编辑