The 16th Heilongjiang Provincial Collegiate Programming Contest
question
You are given a sequence consisting of N integers { a i } \{ai\} { ai}. There will be mm different events.
- A N D l r v − f o r a l l e l e m e n t s a i ( l ≤ i ≤ r ) , c h a n g e a i t o a i & v , w h e r e & m e a n s b i t w i s e A N D AND \;\;l \;r \;v - for \;\;all \;\;elements\;\; a_i\;\;(l≤i≤r),change \;\;a_i \;\;to\;\; a_i \& v,where\;\; \&\;\; means\;\; bitwise\;\; AND ANDlrv−forallelementsai(l≤i≤r),changeaitoai&v,where&meansbitwiseAND
- U P D x v − c h a n g e a x t o v UPD \;\; x\;v-change \;\;a_x \;\;to \;\; v