原创 NYOJ 600 花兒朵朵

描述 輸入第一行有個整數t,表示有t組測試數據,每組測試數據第一行爲兩個整數n,m(0<n<100000,0<m<100000);隨後有n行,每一

原创 Uva 1395

題目鏈接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=105277#problem/B 題意: 給出一個n節點的圖,邊最多爲n*(n-1)/2條邊,求苗條度(最大邊權值減最

原创 能量項鍊

題目描述 Description 在Mars星球上,每個Mars人都隨身佩帶着一串能量項鍊。在項鍊上有N顆能量珠。能量珠是一顆有頭標記與尾標記的珠子,這些標記對應着某個正整數。並且,對於相鄰的兩顆珠子,前一顆珠子的尾標記一定等於後

原创 POJ 3321 Apple Tree

Description There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka

原创 Running Track

Description A boy named Ayrat lives on planet AMI-1511. Each inhabitant of this planet has a talent. Specifically, A

原创 geometry

問題描述 在平面直角座標系上有一個點P, 他的座標是(x,y). 有一條直線y=kx+by經過了P, 且分別交x,y正半軸於A,B. 求∣PA∣∗∣PB∣的最小值. 輸入描述 第一行一個T, 表示數據組數. 接下來T行每行兩個正整

原创 CF 338 Hexagons

Description Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by he

原创 NYOJ 35 表達式求值 or 267 鬱悶的C小加(二)

描述 聰明的你幫助C小加解決了中綴表達式到後綴表達式的轉換(詳情請參考“鬱悶的C小加(一)”),C小加很高興。但C小加是個愛思考的人,他又想通過這種方法計算一個表達式的值。即先把表達式轉換爲後綴表達式,再求值。這時又要考慮操作數是小數和

原创 BC66 GTW likes gt

Problem Description Long long ago, there were n adorkable GT. Divided into two groups, they were playing games togeth

原创 BC 68 Tree

問題描述 有一個樹(n個點, n−1條邊的聯通圖),點標號從1~n,樹 的邊權是0或1.求離每個點最近的點個數(包括自己). 輸入描述 第一行一個數

原创 Longtail Hedgehog

Description This Christmas Santa gave Masha a magic picture and a pencil. The picture consists of n points connected

原创 Multipliers

Description Ayrat has number n, represented as it's prime factorization pi of size m, i.e. n = p1·p2·...·pm. Ayrat g

原创 ACM算法羣賽

題目鏈接: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=104302#overview Problem A Description 有兩堆石子,數量任意,可以不同

原创 Suzhou Adventure

描述 Little Hi is taking an adventure in Suzhou now. There are N beautiful villages in Suzhou which are numbered from 1

原创 數軸染色

題目描述 Description 在一條數軸上有N個點,分別是1~N。一開始所有的點都被染成黑色。接着 我們進行M次操作,第i次操作將[Li,Ri]這些點染成白色。請輸出每個操作執行後 剩餘黑色點的個數。 輸入描述 Inpu