原创 POJ 2470 Relatives (歐拉函數)
Relatives Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15269 Accepted: 7731 Description Given n
原创 POJ 3761 Bubble Sort
Bubble Sort Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2842 Accepted: 982 Description Bubble
原创 POJ 3233 Matrix Power Series (矩陣快速冪)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 26027 Accepted: 10705 Descript
原创 2017 ACM-ICPC 亞洲區(西安賽區)網絡賽 B Coin(逆元,費馬小定理)
Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(
原创 HDU 3836 Equivalent Sets(強連通+縮點,tarjan)
Equivalent Sets Time Limit: 12000/4000 MS (Java/Others) Memory Limit
原创 POJ 3177 Redundant Paths(邊雙連通分量+tarjan)
題目鏈接:http://poj.org/problem?id=3177 題目大意:給你一個連通圖,問你最少添加幾條邊能組成一個邊雙連通圖,有重邊 思路:我們將所有的雙連通塊看成一個點,因爲他們是連通的且不成一個環,利用tarjan縮點後就
原创 POJ 1523 SPF(割點,分塊,tarjan)
題目鏈接:http://poj.org/problem?id=1523 題目大意:問你圖中有哪些割點,並且這些割點能將圖分成幾塊 思路:因爲是無向圖且沒有重邊,tarjan判斷下是否爲割點就可以了,如果 是根節點,且根節點有多於一棵子樹,
原创 HDU 2588 GCD (歐拉函數)
GCD Time Limit: 2000/1000 MS (Java/Others) Memory Limit
原创 FZU 2271 X(Floyd)
Problem 2271 X Accept: 166 Submit: 584 Time Limit: 1500 mSec Memory Limit : 32768 KB Problem Description
原创 HDU 1540 Tunnel Warfare (線段樹,區間合併)
Tunnel Warfare Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s)
原创 HDU 4027 Can you answer these queries?(線段樹求區間和)
Can you answer these queries? A lot of battleships of evil are arranged in a line before the