vim /root/ip.sh #! /bin/bash read -p '请输入您要测试的ip: ' ip ping -c 2 $ip &> /dev/null if [ $? -eq 0 ];then echo 可以通信 else echo 不可以通信 创建猜数字小游戏 vim /root/nu ...
分类:
系统相关 时间:
2019-04-10 23:35:15
阅读次数:
231
#include using namespace std; struct Node{ int x, y, d, c; Node(int x = 0, int y = 0, int d = 0, int c = 0):x(x), y(y), d(d), c(c){} bool operator==(c... ...
分类:
其他好文 时间:
2019-04-10 20:26:18
阅读次数:
119
【链接】 "我是链接,点我呀:)" 【题意】 题意 【题解】 统计叶子节点个数m 把每条和叶子节点相邻的边权设置成s/cnt就可以了 这样答案就是2 s/m(直径最后肯定是从一个叶子节点开始,到另外一个叶子节点结束) 证明: 设dis(i,j)表示节点i和节点j之间的权值和 设a[1],a[2].. ...
分类:
其他好文 时间:
2019-04-09 20:34:58
阅读次数:
140
class ObjPool{ final List pool; //信号量实现限流器 final Semaphore sem; //构造方法 ObjectPool(int size,T t){ pool = new Vector(){}; for(int i=0; i func){ T t = nu... ...
分类:
其他好文 时间:
2019-04-09 15:17:10
阅读次数:
168
``` class Solution { public: int minDepth(TreeNode* root) { if (!root) return 0; if (!root->left) return 1 + minDepth(root->right); if (!root->right) ... ...
分类:
其他好文 时间:
2019-04-09 15:09:48
阅读次数:
154
155. Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from t ...
分类:
其他好文 时间:
2019-04-09 12:36:45
阅读次数:
139
``` class Solution { public: int minPathSum(vector &grid) { int m = grid.size(), n = grid[0].size(); int dp[m][n]; dp[0][0] = grid[0][0]; for (int i = ...
分类:
其他好文 时间:
2019-04-09 11:05:24
阅读次数:
106
原文:IoC 依赖注入容器 UnityIoC 是什么? 在软件工程领域,“控制反转(Inversion of Control,缩写为IoC)”是一种编程技术,表述在面向对象编程中,可描述为在编译时静态分析器并不知道具体被耦合的对象,而该对象是在运行时被对象装配器绑定的。 在传统编程中,决定业务流程的... ...
分类:
编程语言 时间:
2019-04-09 00:12:03
阅读次数:
197
什么是IOC Inversion of Control,控制反转,也成依赖倒置。 反转: 依赖对象的创建被反转,使用IOC之前,对象由自己创建,反转后,由IOC容器获取 IOC容器的工作: 负责创建,管理实例 使用IOC的好处: 1.代码简洁,对象的创建有IOC容器提供 2.面向接口编程,使用者和具 ...
分类:
编程语言 时间:
2019-04-08 22:56:01
阅读次数:
157
http://poj.org/problem?id=3041 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 ...
分类:
其他好文 时间:
2019-04-08 13:27:21
阅读次数:
131