高精
ACkingdom
这个人很懒,什么都没有留下
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2020牛客暑期多校训练营(第八场)K.Kabaleo Lite(贪心,高精)
题目链接 思路: 对盈利做个前缀和然后从大往下取,每次取的时候增加的人数是当前的前缀和的最小值减去已经得到的人数。注意数据很大需要用到高精(所以我们用python,手动滑稽)。 代码: t=int(input()) for i in range(t): n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) mn=b[0] ans=a[0]*b[0] su原创 2020-08-05 21:58:30 · 210 阅读 · 0 评论 -
洛谷-P1080 国王游戏(贪心,高精)
题目链接 思路: 左右手乘积大的要排到后面,中间需要用到高精度,所以我们用Python水过去(学的Python终于有点用了)。 代码: N=int(input()) s=input().split() S=int(s[0]) T=int(s[1]) a=[] for i in range(1,N+1): k=input().split() a.append((int(k[0]),int(k[1]))) a.sort(key=lambda x:x[0]*x[1]) ans=0 for i in原创 2020-07-16 20:11:27 · 234 阅读 · 0 评论
分享