Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let ...
分类:
其他好文 时间:
2019-09-06 18:52:36
阅读次数:
112
转至 平凡的学生族发表于后端技术 在这篇文章中: 前言 环境 目录 0.确立计划 1. 运行master容器 2. 编写redis.conf 3. 解决WARNING THP 4. 解决WARNING somaxconn 5. 最终的docker run 最后 参考 在这篇文章中: 前言 环境 目录 ...
分类:
其他好文 时间:
2019-09-06 17:27:23
阅读次数:
139
直接根据最短distance greedy做。 用了优先队列,C++ less<type> 是大的先,所以我们可以重载<符号,把逻辑反过来。 第二种写法不用结构体,节省了空间复杂度,但是每次cmp的时候都要计算dist,但是时间会翻倍。 这里采用了 lambda funtion,注意 priorit ...
分类:
其他好文 时间:
2019-09-05 13:48:59
阅读次数:
102
此模块只有在unix系统上才有,windows没有。文档地址:https://docs.python.org/3.7/library/fcntl.htmlhttps://www.docs4dev.com/docs/zh/python/3.7.2rc1/all/library-fcntl.html多进程示例程序importfcntlimportosimporttimefrommultiprocess
分类:
编程语言 时间:
2019-09-04 23:10:24
阅读次数:
151
一开始在搞什么贪心,其实这个数据量就应该是搜索。先确定中心点的位置有至多49个,而其中状态不能确定的只有25个。在搜索到已经被覆盖的状态时直接往下一步走就可以了。 cpp include using namespace std; typedef long long ll; int n, m; cha ...
分类:
其他好文 时间:
2019-09-04 13:32:29
阅读次数:
107
钥匙只有10种可以状压,最短路或者bfs都行,但是写挂了(现在还是 ...
分类:
其他好文 时间:
2019-09-03 19:25:03
阅读次数:
84
摘要:syntax sugar 一、?? null-coalescing operator 例如:int y = x ?? -1; 意指将x值指定给y,但如果x值为null时,则将-1指定给y。 二、?: ternary conditional operat... ...
分类:
其他好文 时间:
2019-09-03 14:48:30
阅读次数:
83
priority_queue<int>que//默认最大的先出来 priority_queue<int,vector<int>,greater<int> >que;///最小的先出来 struct node{ int x,y; bool operator < (const node &b)const... ...
分类:
其他好文 时间:
2019-09-02 23:29:34
阅读次数:
102
"题目链接" 问题分析 题意就是求随机取$3$条边能组成长方形的概率。其实可以看做求方案数。 不妨将边长从小到大排序,得到$a_1,a_2,\cdots,a_n$。考虑枚举三角形边长中最大的一条$a_i$,那么$a_i$作为最大边时贡献就是$a_1,a_2,\cdots,a_{i 1}$中两项加起来 ...
分类:
其他好文 时间:
2019-09-02 17:23:02
阅读次数:
70
new operator 我们平时使用的new是new操作符(new operator),就像sizeof一样是语言内置的,不能改变它的含义,功能也是一样的 比如: 相当于 new操作符总是做两件事: 1.调用相应的operator new分配内存 2.调用相应的构造函数 如下代码: operate ...
分类:
编程语言 时间:
2019-09-02 14:08:17
阅读次数:
106