装饰器形成的过程 最简单的装饰器 有返回值的 有一个参数 万能参数装饰器的作用: 最简单的装饰器 装饰有返回值的装饰器 有一个参数 万能参数 装饰器的固定模式 ...
分类:
其他好文 时间:
2018-10-04 10:01:33
阅读次数:
148
代码: 一次基本上就写成功了。虽然好像不如sort快,但是还是得学习一下这种思想这种算法 ...
分类:
编程语言 时间:
2018-10-04 09:05:39
阅读次数:
147
[题目链接] https://codeforces.com/contest/666/problem/B [算法] 首先 , 用BFS求出任意两点的最短路径 然后 , 我们用f[i][0-2]表示从i出发到达的最远三点 , g[i][0-2]表示到i距离最远的三个点 枚举b和c , 然后在枚举3 * ...
分类:
其他好文 时间:
2018-10-02 18:04:15
阅读次数:
162
268. Missing NumberGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.Example 1:Inpu ...
分类:
其他好文 时间:
2018-10-02 17:28:08
阅读次数:
131
传送门 解题思路 快被调死的码农题,,,其实就是一个边权下放到点权的线段树+树剖。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> using namespace ...
分类:
其他好文 时间:
2018-10-01 14:34:54
阅读次数:
171
整形(不可变,存储一个值) 对于int类型的解释 赋值操作 转换操作,如下图所示,如果转换的是number,int括号里面可以为整形也可为浮点型,如果转换的是str,括号里面的字符串必须只能包含整数,负责会报错。如果int里面什么都没有,会返回0。 十进制转换成其他进制的方法 其他进制转换成十进制的 ...
分类:
其他好文 时间:
2018-09-30 18:08:47
阅读次数:
233
测试结果如下: Creating thread 0Creating thread 1Creating thread 2Creating thread 3Creating thread 4Creating thread 5Creating thread 6Creating thread 7cost 2 ...
分类:
其他好文 时间:
2018-09-29 17:44:18
阅读次数:
172
首先是a题,模拟直接求每个点成功的概率 数据规模较小,听说有规律是(n+1)*p 题目链接:https://acm.sicnu.edu.cn/problem/Contest_18_A b题 ,裸拓扑排序,比赛的时候看都没看,有点难受 题目链接:https://acm.sicnu.edu.cn/pro ...
分类:
其他好文 时间:
2018-09-27 20:44:16
阅读次数:
229
最笨方法自己亲测! if (isset($_SERVER['HTTP_USER_AGENT'])) { $clientkeywords = array('iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'java', 'opera ...
分类:
移动开发 时间:
2018-09-27 18:07:25
阅读次数:
155
题意 分析 代码 cpp include using LL = long long; const int MAXN = 1e5 + 5; int n, m, D; std::pair p1[MAXN], p2[MAXN]; struct Event { LL x, y; int val; Event ...
分类:
其他好文 时间:
2018-09-27 00:10:07
阅读次数:
231