題目鏈接 \(Description\) 有一張\(n\)個點的完全圖,每個點的權值為\(a_i\),兩個點之間的邊權為\(a_i\ xor\ a_j\)。求該圖的最小生成樹。 \(n\leq2*10^5,0\leq ai<2^{30}\)。 \(Solution\) 代碼好神 ...
Discription Ehab is interested in the bitwise xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting ofnvertices numbered from ton . Fo ...
2018-04-14 20:20 4 583 推薦指數:
題目鏈接 \(Description\) 有一張\(n\)個點的完全圖,每個點的權值為\(a_i\),兩個點之間的邊權為\(a_i\ xor\ a_j\)。求該圖的最小生成樹。 \(n\leq2*10^5,0\leq ai<2^{30}\)。 \(Solution\) 代碼好神 ...
鏈接 [https://codeforces.com/contest/1174/problem/D] 題意 讓你構造一個數組,使得任意子段異或和不為0也不為x,而且每個數字大於等於1小於(1<<n) 分析 比賽做不出來,還是太垃圾了,這只能說水平不夠。而且我對位運算的題真的 ...
Description 題庫鏈接 給你一張 \(n\) 個點的完全圖,其中有 \(m\) 條邊長度為 \(1\),其余全為 \(0\)。問你這張圖的最小生成樹為多少。 \(1\leq n\leq ...
D. 0-1 MST Ujan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. ...
題意: 定義一個函數f(a): 給出一個數組a,有q個詢問,每次詢問回答在l到r的區間內,連續子串的f函數的最大值。 思路: 畫圖,來自codeforces SheepRanger 由此圖可知,f(l,r) = f(l,r-1) ^ f(l+1,r),多畫圖哇! 所以就變成 ...
E. Danil and a Part-time Job time limit per test 2 seconds memory limit per test 256 megabytes input ...
我們把所有點分成四類 $A_{0,0},A_{0,1},A_{1,0},A_{1,1}$ 發現如果$A_{0,0}+A_{1,1} > 0$並且$A_{0,1}+A_{1,0} > 0 ...
傳送門 這是一道英語題,首先要讀懂題目: $\text{Alex believes that his trip will be interesting only if he will not us ...