摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805493648703488 思路 这题的关键在于使用什么数据结构去存输入的数据,以及如何计算每次通话的费用。一开始我考虑了一个非常复杂的方法,发现写了一百多行代码 阅读全文
posted @ 2020-01-31 20:45 aopstudio 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805495863296000 思路 这题要求判断一个数在翻转前后是否都是质数。有一个难以理解的地方是在给定进制下的翻转,这是指转成该进制表示的数之后翻转,再将翻转后 阅读全文
posted @ 2020-01-31 13:49 aopstudio 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805498207911936 思路 这题需要用到队列,而且不止一条。首先是每个等待窗口各需要一条,另外在黄线外的等待顾客需要一条。C++提供了现成了现成的队列类型, 阅读全文
posted @ 2020-01-27 21:20 aopstudio 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805500414115840 思路 题目大意是说一些城市之间有路相通,假设其中一个城市被敌方占领了,计算需要新修多少条路才能让剩下的城市全部联通。首先这是一个典型的 阅读全文
posted @ 2020-01-27 21:17 aopstudio 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805504927186944 思路 这题就很简单了,每行输入的时候找出最大的记录下来,同时记录下标。输入完毕后根据下标转换成结果(W,T,L)并储存起来,再根据每行 阅读全文
posted @ 2020-01-22 20:30 aopstudio 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805507225665536 思路 这题是到目前为止比较难的一题,评测系统的通过率也只有 0.11。 首先需要理解基本题意。题目的要求是给一个已知进制的数,求能不能 阅读全文
posted @ 2020-01-22 20:09 aopstudio 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805509540921344 思路 之前 1002 中问的是多项式的加法,这题则变成了多项式的乘法。前面的数据结构基本上一样,定义一个多项式元素结构体 poly,以 阅读全文
posted @ 2020-01-17 11:41 aopstudio 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805511923286016 思路 这题应该是到目前为止最简单的一道题,评测系统的通过率统计也达到了惊人的0.59。 我们需要定义以下用于计算的变量: :当前所在的 阅读全文
posted @ 2020-01-16 17:22 aopstudio 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805514284679168 寻找解法 这题一开始有点懵,一开始以为是选个固定长度的最大子串,那样会简单很多。但并不是,子串的长度是没有限制的,于是复杂度一下子上去 阅读全文
posted @ 2020-01-16 17:19 aopstudio 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 原题链接 https://pintia.cn/problem sets/994805342720868352/problems/994805516654460928 思路 这题思路很简单,先读第一个人的 in 和 out 时间,暂存为 unlock 和 lock 的时间,并把该人同时暂记为 unlo 阅读全文
posted @ 2020-01-16 17:17 aopstudio 阅读(190) 评论(0) 推荐(0) 编辑
Live2D