1
20
2015
2

BZOJ3576: [Hnoi2014]江南乐 $O(M \times \ln{M} \times \log{M})$

又被标算虐……虐代码长度虐常数
考虑暴力:对于每个$n$,$sg[n]=mex\{(-1)^{n\%d} sg[n/d+1]\ xor\ (-1)^{d-n\%d}sg[n/d]\}$
可以把sg值压位解决mex。
考虑枚举d,枚举d的倍数之间的区间,把区间内奇偶性相同的位置都|=一个值。用线段树。
但是sg[n/d]的计算顺序不一定对。
所以应该枚举n/d,再枚举d,对每个d扩展一下。
但是这个做法在f<=2时还是不对。
所以特判打表。
这样复杂度就是$O(M \times \ln{M} \times \log{M})$

最近真的是弱到渣了,代码能力奇弱,几乎没有1A的。冬令营都没得去。人生真的是希望渺茫了。会考真的是……

 

 

Category: 未分类 | Tags: | Read Count: 1178
Avatar_small
BSNL Customer Care n 说:
2022年8月08日 15:34

The new digital era based support system contributing a lion’s sharing related to all telecom services in 2021 calendar year, also find the new email address providing BSNL complaint process for payment failed issues for any digital payment service failure related issues like repayment, The new digital era based support system contributing a lion’s sharing related to all telecom services in 2021 calendar year, BSNL Customer Care number refund of debited amount and service activation /deactivation, complaints, tariff change requests.

Avatar_small
Meghalaya Board Ques 说:
2022年8月25日 14:52

Meghalaya Board Model Paper 2023 Class 2 Pdf Download with Answers for Bengali Medium, English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams at official website. Meghalaya Board Question Paper Class 2 New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com