[LeetCode]148.Merge Two Sorted Lists
【題目】 Sort a linked list in O(n log n) time using constant space complexity. 【分
[LeetCode]Text Justification
Given an array of words and a length L, format the text such that each line ha
A sequence of numbers(快速求冪)
題目描述 Xinlv wrote some sequences on the paper a long time ago, they might b
BZOJ 3834 Poi2014 Solar Panels 數論
題目大意:給定a,b,c,d,多次詢問a<=x<=b,c<=x<=d時Gcd(x,y)的最大值ぽい floor((c-1)/n)ぽい 由於後面的式
UVA1395 Slim Span(kruskal算法)
Slim Span [PDF Link] Given an undirected weighted graph G , you should fi
HDU 2056 Rectangles
這題就是簡單的幾何題,剛接觸ACM做這題時,不會寫,當時想的太復雜了,把矩形的各種情況組合都考慮到了,結果發現這樣太復雜就放棄了。今天做這道題時,我突然發現既然
BZOJ 2786 Ural1142 Relation 遞推
題目大意:用=和<連接n個元素,等號之間看做一個整體,求方案數 令f[i][j]表示i個數劃分成j個有序集合的方案數 如果將第i個數劃分進原有的集合中,方案數為