原创 Codeforces 840C. On the Bench

A year ago on the bench in public park Leha found an array of n numbers. Leha believes that permutation p is right

原创 Codeforces 979C

題意:給定一個n個點,n-1條邊的無向圖,途中任意兩點聯通,並給出節點x,y,計算圖上兩點(u,v)之間的最短路徑依次經過x,y的對數,(u,v)與(v,u)視作不同一對,求總對數-符合條件的對數---------------------