原创 [usaco] 5.4.4 Betsy's Tour

 好久沒作usaco了。過了個年,人都懶了。 Betsy's Tour Don Piele A square township has been divided up into N2 square plots (1 <= N <=

原创 Presto內存泄露問題調查

問題背景: sls的線上流量越來越大,S1幾乎增長了100%。在杭州region,每隔一段時間,一部分機器Presto就會開始頻繁的Full GC,重啓後穩定一段時間,然後過一段時間又開始頻繁Full GC。Full GC達到一定

原创 Presto 任務調度: 任務分配到哪裏

在調度任務時,有幾個決策點,第一:分配多少個任務,第二:每個任務分配到哪些機器上。 要回答這個問題,首先把計算任務做一下分類,在presto內部有4種計算類型的節點: source節點,讀源數據的節點,負責讀取數據、Map階段的

原创 Procella@Youtube 把計算加速玩到極致的實時計算引擎

Procella的應用場景 在youtue內部,在數據分析領域有4個方面的應用場景: 報表和大盤:1000億數據/天,要求在10ms的延時內完成近實時的計算,主要的計算類型過濾/聚合/set/join 內嵌的統計指標,例如視頻的

原创 [usaco]5.3.4強聯通分支,雙聯通分支 Network of Schools

  Network of Schools IOI '96 Day 1 Problem 3 A number of schools are connected to a computer network. Agreements have

原创 [usaco]4.3.1 最長遞減子序列 和超級整型數

Buy Low, Buy Lower The advice to "buy low" is half the formula to success in the stock market. But to be considered a g

原创 [usaco]4.1.3 Fence Rails 多維揹包問題,dfsid

 Fence Rails Burch, Kolstad, and Schrijvers Farmer John is trying to erect a fence around part of his field. He has de

原创 [usaco]4.2.1 最大流問題Drainage Ditches

  Drainage Ditches Hal Burch Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover

原创 [usaco]4.2.2偶圖匹配 The Perfect Stall

The Perfect Stall Hal Burch Farmer John completed his new barn just last week, complete with all the latest milking te

原创 [usaco] 4.1.4 PROB Cryptcowgraphy

Cryptcowgraphy Brian Dean The cows of Farmer Brown and Farmer John are planning a coordinated escape from their respec

原创 c、c++、java的區別

c++和java的區別 一羣寫機頂盒程序的人在用c++寫程序的時候感覺C++太過於瑣碎,於是發明了java 1:c+程序直接運行於OS上;java程序運行於jvm上 2:執行效率,c++明顯比java要快很多,因爲java是通過運行在虛擬

原创 [usaco]5.4.5 Big Barn題解

5   Big Barn A Special Treat Farmer John wants to place a big square barn on his square farm. He hates to cut down tree

原创 [usaco] 4.4.1PROB Shuttle Puzzle

  Shuttle Puzzle Traditional The Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, and a strip of

原创 鍵盤鉤子

最近在做一個項目,要求程序在後臺運行是能夠攔截到按鍵信息。 但是,在ddl裏邊給對話框發送消息總是不成功。檢查了一天,看了很多人寫過的程序,還是不得要領。最後突然想到,sendmessage和postmessage的作用是一樣的,只不過前

原创 [usaco]5.3.2 Milk Measuring 動態規劃

  Milk Measuring Hal Burch Farmer John must measure Q (1 <= Q <= 20,000) quarts of his finest milk and deliver it in o