2008年10月1日星期三

ZJU/ZOJ 1569 Partial Sums 解题报告

题目大意是求一段序列中子序列之和除m余0的子序列数量。

用sum[i]表示∑a[i],题目所求即所有(sum[i]-sum[j]) mod m=0的组合数量(包括sum[0])。(sum[i]-sum[j]) mod m=0即sum[i]与sum[j]除m的余数相同,所以可以记录sum[i]除m的每种余数的数量。用f[j]表示sum[i]除m余j的数量,则ans=∑f[j]*(f[j]-1)/2。

1653449    2008-10-01 23:23:58     Accepted    1569    FPC    10    120    IwfWcf

3 条评论:

  1. roshe run, http://www.rosherunshoessale.com/
    tory burch outlet, http://www.toryburchoutletonline.in.net/
    ralph lauren uk, http://www.ralphlauren-outletonline.co.uk/
    michael kors outlet, http://www.michaelkorsoutlet.org.uk/
    ralph lauren outlet, http://www.ralphlaurenoutlet.in.net/
    asics, http://www.asicsisrael.com/
    nike free, http://www.nikefreerunning.org/
    coach handbags, http://www.coachhandbagsoutletonline.us.com/
    christian louboutin uk, http://www.christianlouboutinoutlet.org.uk/
    replica watches, http://www.replicawatchesforsale.us.com/
    hogan, http://www.scarpehogan-outlet.it/
    stuart weitzman boots, http://www.stuartweitzmanoutlet.us/
    basketball shoes, http://www.basketballshoes.us.com/
    ray ban sunglasses, http://www.raybansunglass.us.com/
    nike huarache, http://www.nikeairhuarache.org.uk/
    prada outlet, http://www.pradaoutlet.us/
    michael kors handbags, http://www.michaelkorshandbag.co.uk/
    air jordan 13, http://www.airjordan13s.com/
    air max 90, http://www.airmax90.us.com/
    mulberry outlet, http://www.mulberryoutlet.com.co/
    hollister, http://www.hollistercanada.com/
    toms shoes, http://www.toms.us.com/
    louis vuitton outlet, http://www.louisvuittonoutletstore.name/
    true religion jeans, http://www.truereligionjean.in.net/
    ugg boots, http://www.uggboot.com.co/
    michael kors outlet, http://michaelkors.outletonlinestores.us.com/
    nike air max uk, http://www.nikeairmaxshoes.org.uk/
    air jordan 11, http://www.airjordan11.net/
    1003maoqiuyun

    回复删除

相关文章

 
Creative Commons License
除非另有声明,本网站采用知识共享署名-非商业性使用-相同方式共享 3.0 许可协议授权。