原创 HDU - 5988 Coding Contest(最小費用流)

HDU - 5988 Coding Contest(最小費用流) A coding contest will be held in this university, in a huge playground. The whole

原创 HDU - 5646 DZY Loves Partition (二分 + 數學)

HDU - 5646 DZY Loves Partition (二分 + 數學) DZY loves partitioning numbers. He wants to know whether it is possible to

原创 洛谷 P2921 在農場萬聖節Trick or Treat on the Farm (tarjan求強連通分量)

洛谷 P2921 在農場萬聖節Trick or Treat on the Farm (tarjan求強連通分量) 題目描述 每年,在威斯康星州,奶牛們都會穿上衣服,收集農夫約翰在N(1<=N<=100,000)個牛棚隔間中留下的糖

原创 HDU - 5934 Bomb(tarjan縮點)

HDU-5934 Bomb(tarjan縮點) There are N bombs needing exploding. Each bomb has three attributes: exploding radius ri,

原创 POJ - 3122 Pie (二分)

POJ - 3122 Pie (二分) My birthday is coming up and traditionally I’m serving pie. Not just one pie, no, I have a numb

原创 HDU - 6237 - A Simple Stone Game( 分解質因子)

HDU - 6237 - A Simple Stone Game( 分解質因子) After he has learned how to play Nim game, Bob begins to try another stone

原创 HDU - 5256 序列變換(nlogn求最長上升子序列)

HDU - 5256 序列變換(nlogn求最長上升子序列) 我們有一個數列A1,A2…An,你現在要求修改數量最少的元素,使得這個數列嚴格遞增。其中無論是修改前還是修改後,每個元素都必須是整數。 請輸出最少需要修改多少個元素。

原创 CodeForces - 371C Hamburgers (二分)

CodeForces - 371C Hamburgers (二分) Polycarpus loves hamburgers very much. He especially adores the hamburgers he mak

原创 HDU - 4190 Distributing Ballot Boxes (二分 最大值最小)

HDU - 4190 Distributing Ballot Boxes (二分 最大值最小) Today, besides SWERC’11, another important event is taking place in

原创 樹狀數組(單點更新-區間查詢,區間更新-單點查詢,區間更新-區間查詢,二維樹狀數組)

樹狀數組(單點更新-區間查詢,區間更新-單點查詢,區間更新-區間查詢) 樹狀數組和線段樹的比較: 1.都用來求區間問題,優化時間複雜度。它和線段樹有着相似的功能,都能求,單點更新-區間查詢,區間更新-單點查詢,區間更新-區間查詢

原创 POJ - 3258 River Hopscotch(二分找最小值最大)

POJ - 3258 River Hopscotch(二分找最小值最大) Every year the cows hold an event featuring a peculiar version of hopscotch th

原创 numpy庫的使用

爲什麼要引入numpy庫? numpy 把一個數組 當作一個數據來進行計算,可以去掉元素之間所需要的循環 使得一維數組當作一個數據單元。 底層是基於C語言的,計算速度較快。 def npsum(): a = np.arra

原创 給定三角形的三點 求外心

Point heart(int a,int b,int c) { double a1=p[b].x-p[a].x; double b1=p[b].y-p[a].y; double c1=(p[b].x*p

原创 最大空凸包 (板子)

問題:給定一個點集S,求一個面積最大的凸多邊形C,其中他的邊界由S中的點組成,且任意p∈S−C不在C多邊形內部 #include <iostream> #include <cmath> #include <cstdio> #in

原创 HDU - 5929 - Basic Data Structure

HDU - 5929 - Basic Data Structure Mr. Frog learned a basic data structure recently, which is called stack.There ar