Problem : The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find ...
分类:
其他好文 时间:
2020-04-13 12:22:42
阅读次数:
64
1:题目描述 输入一个递增排序的数组和一个数字s,在数组中查找两个数,使得它们的和正好是s。如果有多对数字的和等于s,则输出任意一对即可。 示例 1: 输入:nums = [2,7,11,15], target = 9输出:[2,7] 或者 [7,2]示例 2: 输入:nums = [10,26,3 ...
分类:
其他好文 时间:
2020-04-13 12:16:05
阅读次数:
69
作用:通过指针访问结构体中的成员。 利用操作符->可以通过结构体指针访问结构体属性。 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 //1.定义结构体 6 struct Student 7 { 8 strin ...
分类:
其他好文 时间:
2020-04-13 12:13:09
阅读次数:
55
一、函数的运用 1,strstr(a,b); 判断b是否为a的子串,如果是,返回从b的开头开始到a的结尾 如“abcdefgh” “de” 返回“defgh”; 如果不是子串,返回NULL; 2,memcpy(a,b+n,c); 将b串从第n位后的c个字符串复制到a中 (注:做完函数后需要添加上b[ ...
分类:
编程语言 时间:
2020-04-13 01:14:01
阅读次数:
110
这位大佬写的博客介绍的很详细,通俗易懂 https://blog.csdn.net/qq_38930523/article/details/89888915 自己敲了一遍代码... 线性均分纸牌: 1 #include<iostream> 2 #include<stdio.h> 3 using na ...
分类:
其他好文 时间:
2020-04-13 01:01:51
阅读次数:
69
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace MyStringHelper { /// /// 字符串操作类 /// ...
分类:
其他好文 时间:
2020-04-13 00:50:23
阅读次数:
55
#include <iostream>#include <algorithm>using namespace std;const int MAX=1010;int f[MAX][MAX];//表示装了前i个背包后的最大价值是多少int v[MAX],w[MAX];int main(){ int n, ...
双亲委派加载模型 为什么需要双亲委派加载模型 主要是为了安全,避免用户恶意加载破坏 正常运行的字节码文件,比如说加载一个自己写的 。这样就有可能造成包冲突问题。 类加载器种类 启动类加载器:用于加载 中`rt.jar`的字节码文件 扩展类加载器:用于加载 中`/jre/lib/ext`文件夹下的字节 ...
分类:
其他好文 时间:
2020-04-12 22:16:38
阅读次数:
62
applyMiddleware是另一个核心函数 首先我们需要知道如何使用中间件 eg: import { createStore, applyMiddleware } from 'redux' import todos from './reducers' function logger({ getS ...
分类:
移动开发 时间:
2020-04-12 20:59:34
阅读次数:
87
C HDU_5578 求字符串中所有相同字母的最小距离H。 Input 实例个数T然后T行字符串字符串中仅含有小写字母。1≤T≤501≤len≤1000(len为字符串长度) Output 对于每个实例输出Case #t: H,表示第t个实例的答案是H。 如果没有相同的字母,H=-1。 Sample ...
分类:
其他好文 时间:
2020-04-12 20:58:54
阅读次数:
73