实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll"输 ...
分类:
其他好文 时间:
2020-06-28 00:27:11
阅读次数:
49
String: 下面三条语句分别创建了几个对象: String s1=new String("abc");// 2 堆中一个,方法区一个 String s2="abc";// 0 String s3=new String("abc");// 1 堆中一个 String s4="he"+"ll"+"o ...
分类:
编程语言 时间:
2020-06-27 20:20:43
阅读次数:
53
1、显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录 [root@node1 etc]# ll total 0 -rw-r--r--. 1 root root 0 Jun 28 00:23 11test -rw-r--r--. 1 root root 0 Jun ...
分类:
系统相关 时间:
2020-06-27 17:25:37
阅读次数:
67
临时修改umask值,(umask 044;touch a.txt;ll a.txt) [root@localhost ~]# (umask 044;touch a.txt;ll a.txt) -rw--w--w- 1 root root 0 Jul 29 00:12 a.txt ()表示在子she ...
分类:
其他好文 时间:
2020-06-26 16:41:15
阅读次数:
77
裸题:https://ac.nowcoder.com/acm/contest/5929/B #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; int n; st ...
分类:
其他好文 时间:
2020-06-26 16:23:42
阅读次数:
104
直接判断单价和单买就可以 #include<bits/stdc++.h> #include<string.h> using namespace std; #define rep(i,j,k) for(LL i=(j); i<(k); ++i) #define pb push_back #define ...
分类:
其他好文 时间:
2020-06-26 10:58:28
阅读次数:
67
求有多少在a前面的数比a小的思路: 在看之前,你必须了解树状数组的基本函数 inline ll lowbit(ll x) { return x&(-x); } inline void insert(ll x,ll y)//加入 { while(x<=n) { sum[x]+=y; x+=lowbit ...
分类:
编程语言 时间:
2020-06-25 23:39:01
阅读次数:
83
就是线性代数的初等行变化: 倍加。 倍乘。 交换行。 #include <bits/stdc++.h> #define mp make_pair #define pb push_back using namespace std; typedef long long ll; typedef pair< ...
分类:
其他好文 时间:
2020-06-25 21:24:54
阅读次数:
60
1:先在su环境进行测试,启动终端; 使用 sudo su 进入su模式; 使用 pwd 查看当前目录; 使用 ll -a (因为 bashrc是隐藏目录 必须要-a参数) 发现当前目录存在bashrc 文件。 使用 cd ~ 该命令会切换到家目录 ; 使用 pwd 发现切换到 root 目录; 使 ...
分类:
系统相关 时间:
2020-06-25 19:43:31
阅读次数:
231
FIRST集合 定义 可从α推导得到的串的首符号的集合,其中α是任意的文法符号串。 规则 计算文法符号 X 的 FIRST(X),不断运用以下规则直到没有新终结符号或 ε可以被加入为止 : (1)如果 X 是一个终结符号,那么 FIRST(X) = X。 (2)如果 X 是一个非终结符号,且 X - ...
分类:
其他好文 时间:
2020-06-25 15:43:42
阅读次数:
88