Subscribed unsubscribe Subscribe Subscribe

0w1

Hi everyone, please feel free to have discussions with me!

CFR 785 E. Anton and Permutation ( RBST on BIT )

Problem - E - Codeforces題意: 一開始你有一個序列 P = { 1, 2, 3, .. N }。處理 Q 筆永久詢問,給 L, R,將 P[ L ] 和 P[ R ] 交換後,輸出當前 P 的逆序述對數。資料規模: The first line of the input contains two integers n and q (1 ≤ n ≤ 200 000…