码迷,mamicode.com
首页 >  
搜索关键字:discounts ciga buy cheap ciga    ( 1427个结果
POJ2828 Buy Tickets
有N个人排队,每一个人都有一个val来对应,每一个后来人都会插入当前队伍的某一个位置pos。要求把队伍最后的状态输出。 倒序插入,线段树单点更新,从头到尾输出线段树的状态 #include<cstdio> #include<algorithm> #include<cstring> using nam ...
分类:其他好文   时间:2020-02-17 19:51:39    阅读次数:77
【PAT甲级】1092 To Buy or Not to Buy (20分):哈希
题目:https://pintia.cn/problem sets/994805342720868352/problems/994805374509498368 1092 To Buy or Not to Buy (20分) Eva would like to make a string of be ...
分类:其他好文   时间:2020-02-09 14:57:03    阅读次数:54
To Buy or Not to Buy - Hard Version
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b ...
分类:其他好文   时间:2020-02-09 00:38:57    阅读次数:93
Codeforces Round #377 (Div. 2)
题目链接:https://codeforces.com/contest/732 A Buy a Shovel 题意:有无穷枚10元硬币和1枚r元硬币,且r是[1,9]。每个物品的单价是x元,求最少买多少件不用找钱。 题解:记得区分用r元和不用r元两种情况,分别对应模10的余数为r或者为0。现在枚举不 ...
分类:其他好文   时间:2020-02-09 00:26:47    阅读次数:94
LeetCode 188. Best Time to Buy and Sell Stock IV (动态规划)
"题目" 题意:给你一个数组代表每天的股价。你有k次买入和卖出的机会,问你最多能赚多少钱。买入之前必须卖出已有股份。同一天是可以先买,再卖,或者先卖再买的。 题解:题目没有说数据范围,但是经过我实际测试 k 最大为10^8 ,n最大为10^4。当然k最多只需要取n/2就好了,因为当天买当天卖是没有意 ...
分类:其他好文   时间:2020-02-04 14:15:49    阅读次数:73
代码实测:给redis中的key取一个正确的名字多么重要
redis对写入的key长度有限制吗? 太长的key对性能有影响吗? key越长对性能影响越大? 如何评估键长度对性能的影响? talk is cheap, show me the code! 今天我们一起用代码来验证一下key的长度对redis读取key的性能影响。 网络环境:本地 内存:8G r ...
分类:其他好文   时间:2020-02-03 12:14:31    阅读次数:113
用代码说话:如何正确启动线程
先来看下结论:正确启动线程的方式是使用start()方法,而不是使用run()方法。 代码实战 1. 输出线程名称 “Talk is cheap. Show me the code”,用代码说话:分别调用run()方法和start()方法,打印输出线程的名字。 运行结果: 2. 深入一点 如果代码是 ...
分类:编程语言   时间:2020-01-29 21:44:14    阅读次数:88
PAT Advanced 1092 To Buy or Not to Buy (20) [Hash散列]
题目 Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings o ...
分类:其他好文   时间:2020-01-29 01:03:21    阅读次数:73
PAT Advanced 1092 To Buy or Not to Buy (20分)
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b ...
分类:其他好文   时间:2020-01-25 16:43:03    阅读次数:104
The Preliminary Contest for ICPC Asia Xuzhou 2019
B.so easy 并查集,可能会卡掉map,建议使用unordered_map。 C.Buy Watermelon 签到,大于2的偶数都可以被拆分成两个偶数和。 cpp include using namespace std; const int N = 1e6+100; const int mo ...
分类:其他好文   时间:2020-01-24 18:40:04    阅读次数:61
1427条   上一页 1 ... 5 6 7 8 9 ... 143 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!