题目标签:Greedy 利用priority queue, 把石头重量都存入 pq, 每次取最大两个比较,存入差值,直到pq 只剩最后一个。 Java Solution: Runtime: 1 ms, faster than 92.5% Memory Usage: 37.1 MB, less tha ...
分类:
其他好文 时间:
2020-02-15 09:16:54
阅读次数:
103
sysctl.conf #增加tcp侦听队列 net.core.somaxconn = 2048 #修改内核分配内存的方式(1:内核允许分配所有的物理内存) vm.overcommit_memory = 1 #进程最大打开文件描述符数 fs.file-max = 1000000 #socket 读写 ...
分类:
系统相关 时间:
2020-02-14 22:18:50
阅读次数:
100
原题链接https://codeforces.com/problemset/problem/79/D 原题描述 D. Password time limit per test 1 second memory limit per test 256 megabytes input standard in ...
分类:
其他好文 时间:
2020-02-14 16:56:02
阅读次数:
103
C - Piggy-Bank HDU - 1114 Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this ...
分类:
其他好文 时间:
2020-02-14 16:24:58
阅读次数:
72
Why is there no risk to the customer when a bank prints the customer's name on his cheques? When anyone opens a current account at a bank, he is lendi ...
分类:
其他好文 时间:
2020-02-13 16:48:19
阅读次数:
67
Exceptions用于处理Run-time Error; //文件读取的异常捕获伪代码 try{ open the file; determine its size; allocate that much memory; read the file into memory; close the f ...
分类:
编程语言 时间:
2020-02-13 09:45:51
阅读次数:
67
工作中,我们经常会遇到端口占用的问题,下面介绍几种常用查看方法。 一、使用lsof 使用-i参数查看端口占用情况 lsof -i:80 二、使用netstat 参数 -a 查看所有 -t (tcp) 仅显示tcp相关选项 -u (udp)仅显示udp相关选项 -n 拒绝显示别名,能显示数字的全部转化 ...
分类:
系统相关 时间:
2020-02-12 21:58:20
阅读次数:
78
Problem : 思路 : Solution (C++) : 性能 : Runtime: 8 ms Memory Usage: 19.9 MB ...
分类:
其他好文 时间:
2020-02-12 20:35:49
阅读次数:
54
JDK和JRE和JVM的关系 JDK(Java Development Kit)是程序开发者用来来编译、调试java程序用的开发工具包 JRE(JavaRuntimeEnvironment,Java运行环境),也就是Java平台。所有的Java 程序都要在JRE下才能运行。普通用户只需要运行已开发好 ...
分类:
其他好文 时间:
2020-02-12 20:20:06
阅读次数:
72
实现三套方案,采集IP信息 首先应该能想到的代码: 存在的问题很明显: 1、复用性差,需要将其封装成方法,然后在进行调用 2、高内聚低耦合原则(这一块代码是负责干啥的,其所有的代码都应该和这个功能是相关的) 举个栗子: 采用高内聚低耦合的原则,迭代上述代码: 思路: 1.将硬盘或者cpu等代码封装成 ...
分类:
数据库 时间:
2020-02-12 19:00:48
阅读次数:
88