2017年08月09日

自己逗比了,题意的子序列没注意,,一直想不出。。。
然后看了别人的,,
有种不知从怎么理解最好-1
http://blog.youkuaiyun.com/yitongjun/article/details/54620176

这种的比较好理解
参考http://www.bubuko.com/infodetail-1917198.html

int a[mxn];
LL dp[mxn][2];
int main(){
  //  freopen("in.txt","r",stdin);
   freopen("azerah.in","r",stdin);
   freopen("azerah.out","w",stdout);
    int T;sf("%d",&T);
    while(T--){
        int n;sf("%d",&n);mem(dp,0);
        rep(i,1,n){ sf("%d",&a[i]);a[i]=a[i]&1; }
        if(a[1]%2)dp[1][1]=1;
        else dp[1][0]=1;
        for(int i=2;i<=n;++i){
            if(a[i]){
                dp[i][1]=(dp[i-1][1]+dp[i-1][0]+1)%mod;
                dp[i][0]=(dp[i-1][1]+dp[i-1][0])%mod;
            }
            else{
                dp[i][1]=(dp[i-1][1]*2)%mod;
                dp[i][0]=(dp[i-1][0]*2+1)%mod;
            }
        }
        pf("%d\n",dp[n][0]);
    }
}

https://vjudge.net/contest/177686#problem/L
手残了。。。自己还是能过的,,不过看别人的思路更好。、
http://blog.youkuaiyun.com/harlow_cheng/article/details/54844966

https://vjudge.net/contest/177686#problem/K (区间dp|| 模拟贪心)
参考这个的,和别人的代码。。
http://www.cnblogs.com/TreeDream/p/6322755.html
我的代码好丑结果,连最基本的地方的算法都错了。
没办法,再做还是错。。算了。。 (就是一种细节提吧。。)

多校五:
https://vjudge.net/contest/177506#problem/F
大概的规律感觉到了,但是思维有点乱,没敲好。。。

https://vjudge.net/contest/177506#problem/H
还说是签到题。。
这个背包还是看不太懂啊。。。
放着吧。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值