ysh's blog
  • 首頁
  • 庫存
  • 分類
  • 標籤
  • 關於
  • Algosolution

Hello World

密碼
2023-06-22

2023.04 TOI 潛力組題解

Repo我終於把專題趕完ㄌ(灑花 A.Icebreakerproblem給你一堆關係,請你分成兩組,問怎麼分可以讓每一組中的任兩個人沒有關係。 solution簡而言之又是個二分圖問題,但這題不需要複雜的演算法,直接DFS就可以ㄌ走到一個點,如果之前沒經過,就幫他上跟父節點相反的顏色(總共只有兩種顏色),但如果之前有經過,就會有兩種情況: 顏色正常(跟父節點相反) 顏色錯誤(跟父節點相同)對於第
2023-04-24
資訊 > 題解
#algo #solution #exam

cses 進階題題解

Meet in the Middle折半枚舉 // Author : ysh // 02/24/2023 Fri 13:28:19.73 // https://cses.fi/problemset/task/1628 #include<bits/stdc++.h> using namespace std; #define int long long void check(int l,int
2023-02-24
資訊 > 題解
#algo #solution #cses

2022.12 TOI 潛力組題解

嗯為什麼我覺得這次好難QAQ BSTproblem給定一顆二元搜尋樹的後序走訪,請你復原這顆二元搜尋樹。 solution因為左子樹的值會小於自己,而右子樹會大於自己,所以我可以採用「認領」的方式實作。 整理一下會發現對於每一個節點,其值必在所有右祖先節點與左祖先節點之間,我們令這兩個值分別為$max,min$$\text{, while}$ $min \leq max$ 。 由於不知道根結點很麻
2022-12-30
資訊 > 題解
#algo #solution #exam

BIT區間加值

緒論眾所周知,BIT能夠實現在$O(n)$空間下單點加值,並計算區間和。至於區間加值則需要使用線段樹及lazy tag。但線段樹code超長,debug很累,而且需要約$4n$的空間。 於是我們想要在BIT上實作區間加值,這有可能嗎? 答案是肯定的。 正文差分差分就是將序列中的每一項改為自己減去前一項之值,也就是說: $g_i = f_i - f_{i - 1}
2022-12-07
資訊 > 演算法
#algo #BIT

微積分上課筆記5

段考範圍 羅畢達定理 when $f(x)$ and $g(x)$ are differentiable and $g’(a)\neq 0$,thenif $\displaystyle \lim_{x \rightarrow a} f(x) = 0$ $\displaystyle \lim_{x \rightarrow a} g(x) = 0$ (or
2022-12-05
數學 > 上課筆記
#math #calculus

2022.11 TOI 潛力組題解

因為感覺沒甚麼人在寫TOI練習賽題解,而且為了拯救快變成修課筆記的競程筆記,想說來寫看看 Cycleproblem給定一有向圖,求能夠到達任一環路的所有點集合。 solution開一個陣列倒著記錄每一個有向邊。再用一個陣列記錄入度,跑一次拓樸排序,剩下入度不為0的點即是環路及可到達環路的點(因為是倒著紀錄)。 code code //
2022-12-01
資訊 > 題解
#algo #solution #exam

微積分上課筆記4

三角函數$sin(sin^{-1}x)=x$$\displaystyle \frac{d}{dx}sin(sin^{-1}x)=\frac{dx}{dx} = 1$$\displaystyle =cos(sin^{-1}x) \frac{d}{dx}sin^{-1}x$$\displaystyle (sin^{-1}x)’ = \frac{1}{c
2022-11-28
數學 > 上課筆記
#math #calculus

微積分上課筆記3

微積分上課筆記微分P.441 $\displaystyle (\ln x)’ = \frac{x’}{x}$ $\text{or}$ $\displaystyle [\ln(g(x))]’ = \frac{g’(x)}{g(x)}$ 求$\displaystyle y=\frac{x^{\frac{3}{4}} \sqrt{x^2+1}}{(3x+2)^5}$之
2022-11-21
數學 > 上課筆記
#math #calculus

微積分上課筆記2

微積分上課筆記 2022/11/16 One to one function for every $y$, there is only at most one $x$ satisfies $f(x) = y$. 例題$f(x)=\sqrt{-1-x}$ $\rightarrow x \leq -1$ => $f^{-1}(x)=
2022-11-16
數學 > 上課筆記
#math #calculus
123

搜尋

Hexo Fluid
總訪問量 次 總訪客數 人