思路其实很简单,无论再少的步骤,至少要能把矮的堆到平均高度,所以只求 sum(avg - ( x >= avg ? 0 : avg - x).sum(); } } 题目来源: https://www.nowcoder.com/practice/f1b67248244c4226a5289c993bc2... ...
分类:
其他好文 时间:
2017-12-13 02:24:51
阅读次数:
179
内容介绍TheApache ActiveMQ message broker is an open source implementation ofthe Java Message Service spec. It makes for a reliable hub in anymessage-orie ...
分类:
其他好文 时间:
2017-12-03 12:54:49
阅读次数:
232
回味 小时候玩的经典贪吃蛇游戏我们印象仍然深刻,谋划了几天,小时候喜欢玩的游戏,长大了终于有能力把他做出来(从来都没有通关过,不知道自己写的程序,是不是能通关了...),好了,闲话不多谈,先来看一下效果吧!! 功能和小时候玩的贪吃蛇一样, 1、选择速度 slow normal fast 2、选择是否 ...
分类:
其他好文 时间:
2017-12-02 16:20:24
阅读次数:
175
c++ 枚举 用到了c++11规范里的多线程,然后编译的时候就报错了,中午各种改CMakeLists没搞定,下午师弟介绍文档,cmake practice,参考第七章,搞定了。 只需要CMakeLists.txt里添加一句话: 开始的时候没有-pthread能make,但运行的时候就崩溃了,参考这里 ...
分类:
编程语言 时间:
2017-11-30 18:06:28
阅读次数:
184
Today we are going to learn the basic concepts of LXC and Docker, get some hands-on experiences on Docker and its networking and prepare for the next study on Kubernetes.
分类:
Web程序 时间:
2017-11-27 16:47:42
阅读次数:
237
Face Recognition for the Happy House Welcome to the first assignment of week 4! Here you will build a face recognition system. Many of the ideas prese ...
分类:
移动开发 时间:
2017-11-27 16:44:30
阅读次数:
216
先对两个数进行位异或,这样能够得到两个数中有多少位是不同的,然后再数一下这个数中有多少位1就可以了。 AC代码: 题目地址: https://www.nowcoder.com/practice/ba033b0d1c2f497da1dd04330cc003af?tpId=49&tqId=29232&t ...
分类:
其他好文 时间:
2017-11-26 11:11:46
阅读次数:
129
25、编写脚本:传递一个字符串给脚本,脚本会将该字符串当作用户名,如果该用户不存在,则添加之并为其设置与用户名相同的密码答:#!/bin/bash#ifid$1&>/dev/null;thenecho"$1isexist."elseuseradd$1echo"$1"|passwd--stdin$1&>/dev/nullecho"create$1successful..
分类:
系统相关 时间:
2017-11-22 13:15:53
阅读次数:
183
23、grep/egrep正则表达式练习:1)显示/etc/passwd文件中不以bash结尾的行;答:#grep-v"bash$"/etc/passwd2)找出ifconfig命令执行结果中的两位或三位整数;答:#ifconfig|grep--color=auto"\<\([[:digit:]]\{2,3\}\)\>"//还有00#ifconfig|grep--color=auto"\<\([1-9]..
分类:
系统相关 时间:
2017-11-21 14:51:51
阅读次数:
190
原地址:http://www.jb51.net/article/23781.htm mysql出现ERROR : (2006, 'MySQL server has gone away') 的问题意思就是指client和MySQL server之间的链接断开了。 造成这样的原因一般是sql操作的时间过 ...
分类:
数据库 时间:
2017-11-20 17:55:43
阅读次数:
214