原创 2015 Multi-University Training Contest 5 1009 模板

比賽鏈接:click here~~ hdu 5344  MZL's xor 【題意】: Problem Description MZL loves xor very much.Now he gets an arr

原创 OO’s Sequence

Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r)

原创 Assignment

Problem Description Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in thi

原创 RMQ——ST算法

RMQ(Range Minimum/Maximum Query)問題是區間最值問題。如果用線段樹,預處理和查詢的複雜度都是O(logn)。而ST算法,可以做到O(nlogn)的預處理,O(1)地回答每個詢問 ST算法實現(以最大值爲例):

原创 Maximum Product(暴力)

Description Problem D - Maximum Product Time Limit: 1 second Given a sequence of integers S = {S1, S2, ..., Sn},

原创 Fractions Again?!(暴力)

It is easy to see that for every fraction in the form  (k > 0), we can always find two positive integers x and y, x ≥

原创 Closest Common Ancestors(LCA)

Description Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v)

原创 JAVA 與CPP的詞法分析

 首先不要被題目嚇倒,本題只是要求寫一個JAVA與CPP程序變量名的轉換程序。   JAVA 的變量形式如下:以小寫字母開頭,然後緊跟0個或多個首字母大寫的單詞組成,比如: javaIdentifier longAndMnemonicI

原创 Drainage Ditches(網絡流_EK模板)

Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clo

原创 Mayor's posters(線段樹+離散化+着色)

Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign hav

原创 Coder(線段樹)

Description   In mathematics and computer science, an algorithm describes a set of procedures or instructions that

原创 Billboard(線段樹)

Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height a

原创 二分圖趣寫(二分圖)

【書本上的算法往往講得非常複雜,我和我的朋友計劃用一些簡單通俗的例子來描述算法的流程】 匈牙利算法是由匈牙利數學家Edmonds於1965年提出,因而得名。匈牙利算法是基於Hall定理中充分性證明的思想,它是部圖匹配最常見的算法

原创 棋盤遊戲(二分圖)

Description 小希和Gardon在玩一個遊戲:對一個N*M的棋盤,在格子裏放盡量多的一些國際象棋裏面的“車”,並且使得他們不能互相攻擊,這當然很簡單,但是Gardon限制了只有某些格子纔可以放,小希還是很輕鬆的解決了這個

原创 50 years, 50 colors(二分圖)

Description On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nice,