原创 HDU 5900 - QSC and Master

Problem DescriptionEvery school has some legends, Northeastern University is the same. Enter from the north gate of Nor

原创 HDU 5898 - odd-even number

Problem Description For a number,if the length of continuous odd digits is even and the length of continuous even digit

原创 Codeforce 723B - Text Document Analysis

Description Modern text editors usually show some information regarding the document being edited. For example, the

原创 NYOJ 30 - Gone Fishing

描述  John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n

原创 Codeforces 723D - Lakes in Berland

Description The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell i

原创 NYOJ 47 - 過河問題

描述 在漆黑的夜裏,N位旅行者來到了一座狹窄而且沒有護欄的橋邊。如果不借助手電筒的話,大家是無論如何也不敢過橋去的。不幸的是,N個人一共只帶了一隻手電筒,而橋窄得只夠讓兩個人同時過。如果各自單獨過橋的話,N人所需要的時間已知;而如果兩人同

原创 HDU 5726 - GCD

Problem Description Give you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There are Q(Q≤100,000)

原创 NYOJ 10 - Skiing

描述 Michael喜歡滑雪百這並不奇怪, 因爲滑雪的確很刺激。可是爲了獲得速度,滑的區域必須向下傾斜,而且當你滑到坡底,你不得不再次走上坡或者等待升降機來載你。Michael想知道載一個區域中最長底滑坡。區域由一個二維數組給出。數組的

原创 NYOJ 61 - 傳紙條(一)

描述 小淵和小軒是好朋友也是同班同學,他們在一起總有談不完的話題。一次素質拓展活動中,班上同學安排做成一個m行n列的矩陣,而小淵和小軒被安排在矩陣對角線的兩端,因此,他們就無法直接交談了。幸運的是,他們可以通過傳紙條來進行交流。紙條要經由

原创 HDU 1532 - Drainage Ditches

Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This

原创 網絡流算法基礎

將每條有向邊想象成傳輸物質的管道。每個管道都有一個固定的容量,可以看作是物質能流經該管道的最大速度(譬如可以想象爲水流和河槽)。頂點是管道間的連接

原创 NYOJ 92 - 圖像有用區域

描述 “ACKing”同學以前做一個圖像處理的項目時,遇到了一個問題,他需要摘取出圖片中某個黑色線圏成的區域以內的圖片,現在請你來幫助他完成第一步,把黑色線圏外的區域全部變爲黑色。          圖1                

原创 HDU 5916 - Harmonic Value Description

Problem Description The harmonic value of the permutation p1,p2,⋯pn is ∑i=1n−1gcd(pi.pi+1) Mr. Frog is wondering about

原创 HDU 5723 - Abandoned country

Problem Description An abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a

原创 Codeforce 723C - Polycarp at the Radio

Description Polycarp is a music editor at the radio station. He received a playlist for tomorrow, that can be