原创 What a Nice Day

棄坑CSDN 轉戰 GitHub cnblog

原创 Operating System 作業-01

文章目錄簡答題3.2、內核採取一些動作以便在兩個進程之間進行切換,請描述一下。3.4、針對UNIX和Linux系統進程init在終止進程方面的作用,情解釋一下。3.7、採用如圖所示的程序,確定A、B、C、D中pid的值。3.10、

原创 並查集模板 hdu-1213

目錄   例題:hdu 1213​ 1、合併的優化 2、查詢的優化——路徑的壓縮 3、優化完成的代碼爲: 例題:hdu 1213 //#include <bits/stdc++.h> #include <iostream> #inclu

原创 好好學習《算法競賽入門到進階》 第一章-算法競賽概述

目錄   一、方法競賽概述(省略) 二、創新能力的培養(省略) 三、訓練平臺(省略) 四、入門知識 1、判題的基本輸入與輸出 2、輸入與輸出函數C 3、輸入結束方式 4、輸入與輸出的效率 5、測試 五、模板的作用 六、題目分類(省略) 七

原创 好好學習《算法競賽入門到進階》 第三章-STL和基本數據結構

  目錄 一、容器 1、vector 2、stack、queue 3、list 4、set 5、map 二、常用函數 1、sort() 2、next_permulation() 一、容器 1、vector vector 是STL的動態數組

原创 Treap樹模板 hdu-4585

目錄   例題:hdu 4585 Treap樹 1、Treap樹的唯一性 2、Treap樹的平衡問題 3、Treap樹的數據結構 4、Treap樹的插入 5、插入過程中維護堆的過程中用到的旋轉 6、尋找第k大的數 O(logn) 7、查詢

原创 冒泡排序模板

// 冒泡排序模板,升序 // 數組從下標1開始存儲 // 存儲n個數 // 只有n < 10000時才能用冒泡排序,否則應使用其他排序方法 #include <bits/stdc++.h> using namespace std;

原创 1LL(1ll) 與 std::to_string()

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode

原创 acwing-week-3-樹-Leetcode-98,94,101,105,102,236,543,124,173,297

目錄 Leetcode-98 Leetcode-94 Leetcode-101 Leetcode-105 Leetcode-102 Leetcode-236 Leetcode-543 Leetcode-124 Leetcode-173 L

原创 acwing-week-2-鏈表-Leetcode-19,237,83,61,24,206,92,160,142,148

目錄 Leetcode-19 Leetcode-237 Leetcode-83 Leetcode-61 Leetcode-24 Leetcode-206 Leetcode-92 Leetcode-160 Leetcode-142 Leet

原创 for (auto x : nums)

class Solution { public: int findDuplicate(vector<int>& nums) { int n = nums.size() - 1; int l = 1

原创 Fibonacci序列、跳臺階循環和遞歸解法

  大家都知道斐波那契數列,現在要求輸入一個整數n,請你輸出斐波那契數列的第n項(從0開始,第0項爲0)。 n<=39 牛客劍指offer斐波那契數列 class Solution: def Fibonacci(self, n)

原创 二分模板

二分模板一共有兩個,分別適用於不同情況。 算法思路:假設目標值在閉區間[l, r]中, 每次將區間長度縮小一半,當l = r時,我們就找到了目標值。 版本1 當我們將區間[l, r]劃分成[l, mid]和[mid + 1, r]時,其

原创 Leetcode-34, 35, 69, 74, 240

Leetcode-34 class Solution{ public: vector<int> searchRange(vector<int>& nums, int target){ if (nums.empty()){ r

原创 Day-07-哈希表和字符串

目錄 例一:LeetCode409 例二:LeetCode290 例三:LeetCode49 例四:LeetCode3 例五:LeetCode187 例六:LeetCode76 // //最簡單的哈希,字符哈希 #includ