摘要: 链接:https://ac.nowcoder.com/acm/problem/16414来源:牛客网小凯手中有两种面值的金币,两种面值均为正整数且彼此互素。每种金币小凯都有无数个。在不找零的情况下,仅凭这两种金币,有些物品他是无法准确支付的。现在小凯想知道在无法准确支付的物品中,最贵的价值是多少金币 阅读全文
posted @ 2020-07-17 15:20 学习使我逍遥 阅读(280) 评论(0) 推荐(0) 编辑
摘要: CodeForces - 1033D 这题是让我们找到a=∏ai,即a为ai的积和,让我们找出a的因子个数; 最终只需求出每个质因子的指数即可,我们可以使用一个map,记录每个质因子对应的指数。 我们对数字进行分类,合法的有p2p2,p4p4,p3p3,pqpq 前三种很好处理,现在考虑pqpq这种 阅读全文
posted @ 2020-05-16 14:39 学习使我逍遥 阅读(181) 评论(0) 推荐(0) 编辑
摘要: B题题目是CodeForces - 1009C Annoying Present 是一开始给我们一个长度为n的全0的数组,然后给我们m次变化,每次变化中给我们一个xi和di,每次的操作是,数组上每个数字都加上xi然后再加上di乘以dist| i - j |, 因为每个数字都要处理,所以我们可以直接处 阅读全文
posted @ 2020-04-25 13:36 学习使我逍遥 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 第一题A题: 这就是个签到题,判断一下x%y是否为0,不为零,则给x+(y-x%y)的值就好了。 #include<map> #include<stdlib.h> #include<iostream> #include<vector> #include<string> #include 阅读全文
posted @ 2020-04-24 19:27 学习使我逍遥 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<set> #define ll long long using namespace std; cons 阅读全文
posted @ 2019-06-27 18:56 学习使我逍遥 阅读(217) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<set> #define ll long long using namespace std; cons 阅读全文
posted @ 2019-06-26 17:08 学习使我逍遥 阅读(212) 评论(0) 推荐(0) 编辑
摘要: You are given two n×mn×m matrices containing integers. A sequence of integers is strictly increasing if each next number is greater than the previous 阅读全文
posted @ 2019-05-08 15:31 学习使我逍遥 阅读(945) 评论(0) 推荐(0) 编辑
摘要: You are given two strings ss and tt, both consisting of exactly kk lowercase Latin letters, ss is lexicographically less than tt. Let's consider list 阅读全文
posted @ 2019-05-08 15:11 学习使我逍遥 阅读(225) 评论(0) 推荐(0) 编辑
摘要: During a break in the buffet of the scientific lyceum of the Kingdom of Kremland, there was formed a queue of nn high school students numbered from 11 阅读全文
posted @ 2019-05-08 13:39 学习使我逍遥 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 题目大意让你改变数组的排序,使前缀和的素数最多; 这是一道模拟题,让你通过判断1和2的个数来解决, 只要特判一下1的个数是零的时候,2的个数是零的时候,或者1只有一个而2的个数又不是0个的时候,剩下的情况我们只有把1的个数分奇数和偶数来考虑,大致思路是这样,接下来就看代码吧 #include<ios 阅读全文
posted @ 2019-05-02 00:29 学习使我逍遥 阅读(247) 评论(0) 推荐(0) 编辑