原创 英語詞彙(一)
1. There is a real possibility that these animals could be frightened, _____ a sudden loud noise. A. being there B. sho
原创 英語詞彙(二)
One has no alternative but to/There is no alternative for one but to fight .Don’t poke your nose into what doesn’t_____
原创 英語詞彙(三)
headstrong 任性,固執的 at odds with 與……不和,與……爭吵; The profit motive is inherently at odds with pri
原创 關於白盒密碼
The challenge that white-box cryptography aims to address is to implement a cryptographic algorithm in software in such
原创 leetcode---529. 掃雷遊戲 dfs
https://leetcode-cn.com/problems/minesweeper/ 讓我們一起來玩掃雷遊戲! 給定一個代表遊戲板的二維字符矩陣。 'M' 代表一個未挖出的地雷,'E' 代表一個未挖出的空方塊,'B' 代表沒有相鄰(
原创 LeetCode---938. 二叉搜索樹的範圍和 遞歸或者迭代
給定二叉搜索樹的根結點 root,返回 L 和 R(含)之間的所有結點的值的和。 二叉搜索樹保證具有唯一的值。 示例 1: 輸入:root = [10,5,15,3,7,null,18], L = 7, R = 15 輸出:32 示例
原创 筆試程序題專項----圖模板(鄰接矩陣)
#include <iostream> #include<queue> #include<stack> using namespace std; #define E 100 //圖的邊數 #define N 100//圖的頂點數 t
原创 kmp程序計算next和改進的next
#include <iostream> #include<queue> #include<stack> using namespace std; int next[100]; //1、val=-1;此時意味着主串和子串的下標都需要加1;
原创 筆試程序題專項----2016年408
對於亂序數組,得到排序後第k個數字的算法複雜度爲O(lgn) 。參考快速排序。 #include<iostream> #include<cstdio> #include<cstring> using namespace std; in
原创 筆試程序題專項----2009年408
多想想有沒有高效的算法,如果1分鐘都能想到的算法,別人考你還要什麼意思? #include<iostream> #include<cstdio> #include<cstring> using namespace std; typ
原创 筆試程序題專項----二叉樹模板
特別是 求兩個結點的最低公共祖先最低公共祖先 O(n) #include<iostream> #include<cstdio> #include<cstring> using namespace std; //定義節點 typedef
原创 揹包問題九講 v1.0
揹包問題九講 v1.0 目錄 第一講 01揹包問題 第二講 完全揹包問題 第三講 多重揹包問題 第四講 混合三種揹包問題 第五講 二維費用的揹包問題 第六講 分組的揹包問題 第七講 有依賴的揹包問題 第八講 泛化物品 第
原创 LeetCode-----456. 132模式
題目連接 https://leetcode-cn.com/problems/132-pattern/ 給定一個整數序列:a1, a2, ..., an,一個132模式的子序列 ai, aj, ak 被定義爲:當 i < j < k 時,
原创 複試上機----poj 1003墜落的螞蟻
題目描述 https://www.nowcoder.com/practice/fdd6698014c340178a8b1f28ea5fadf8?tpId=40&tqId=21420&tPage=5&rp=5&ru=/ta/kaoyan&
原创 神奇的口袋(揹包取法)
題目描述 有一個神奇的口袋,總的容積是40,用這個口袋可以變出一些物品,這些物品的總體積必須是40。John現在有n個想要得到的物品,每個物品的體積分別是a1,a2……an。John可以從這些物品中選擇一些,如果選出的物體的總體積是40,