原创 算法作業2

題目地址: https://leetcode.com/problems/count-of-range-sum/?tab=Description 題目描述 :Given an integer array nums, return

原创 我的算法14

題目地址:https://leetcode.com/problems/candy/#/description 題目描述:There are N children standing in a line. Each child is

原创 算法作業11

題目地址:https://leetcode.com/problems/patching-array/#/description 題目描述:Given a sorted positive integer array nums an

原创 我的算法10

該文章包含三題,爲同一類題目。難道依次增加。 第一題: 題目地址:https://leetcode.com/problems/single-number/#/description 題目描述:Given an array of

原创 floyd最短路徑算法

代碼: #include<bits/stdc++.h> using namespace std; #define LEN 1001 #define MAX INT_MAX int node[LEN][LEN]; void

原创 CCF 201712-3

#include <bits/stdc++.h> using namespace std; char vMon[][4]={"","jan","feb","mar","apr","may","jun","jul","aug","sep",

原创 莫隊

排序巧妙優化複雜度,帶來NOIP前的最後一絲寧靜。幾個活蹦亂跳的指針的跳躍次數,決定着莫隊算法的優劣…… 目前的題型概括爲三種:普通莫隊,樹形莫隊以及帶修莫隊。 若談及入門,那麼BZOJ2038的美妙襪子一題堪稱頂尖。 【例題一】襪子

原创 # 線段樹,樹狀數組,主席樹

線段樹 定義 性質 實現(以求任意連續區間的最小值爲例) 樹狀數組 定義 性質 實現 主席樹—-包括無修改和可修改。 定義 性質 實現 線段樹 定義   用一個滿二叉樹(葉子節點可以爲空)來維護一個連續數組,整

原创 CCF 201712-2

問題描述   有n個小朋友圍成一圈玩遊戲,小朋友從1至n編號,2號小朋友坐在1號小朋友的順時針方向,3號小朋友坐在2號小朋友的順時針方向,……,1號小朋友坐在n號小朋友的順時針方向。   遊戲開始,從1號小朋友開始順時針報數,接下來每

原创 *[leetcode] 30.Substring with Concatenation of All Words

題目地址:https://leetcode.com/problems/substring-with-concatenation-of-all-words/discuss/ 題目描述: You are given a string, s,

原创 算法作業23

題目地址:https://leetcode.com/problems/beautiful-arrangement/#/description 題目描述:Suppose you have N integers from 1 to N. W

原创 [leetcode] 3 Longest Substring Without Repeating Characters

題目地址:https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ 題目描述:Given a string, fin

原创 一個超級優美的gcd算法

int GCD(int a,int b){while(b^=a^=b^=a%=b);return a;} From https://www.cnblogs.com/Paul-Guderian/p/6933799.html

原创 [leetcode] 10 Regular Expression Matching

題目地址:https://leetcode.com/problems/regular-expression-matching/description/ 題目描述: Implement regular expression matchin

原创 [leetcode] 11 Container With Most Water

題目地址: https://leetcode.com/problems/container-with-most-water/description/ 題目描述: Given n non-negative integers a1, a2