CF632A Grandma Laura and Apples

Posted dwj030917

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CF632A Grandma Laura and Apples相关的知识,希望对你有一定的参考价值。

#include<bits/stdc++.h>
using namespace std;
long long n,p,ans=0,total=0,apple=0;
int main()
{
    string a[100000];
    cin>>n>>p;
    p=p>>1;
    for(int i=1;i<=n;i++)
    {
    cin>>a[i];
}
for(int i=n;i>=1;i--)
{
    total=total*2;
    if(a[i]=="halfplus")
        total++;
    apple+=total;
    }
    cout<<apple*p;
    return 0;
}

以上是关于CF632A Grandma Laura and Apples的主要内容,如果未能解决你的问题,请参考以下文章

CodeForces 632C Grandma Laura and Apples (模拟)

Educational Codeforces Round 9 -- A - Grandma Laura and Apples

[2016-03-26][codeforces][632][A][Grandma Laura and Apples]

css Laura C的钢笔..

Can't exit loop in Deaf Grandma from Learn to Program by Chris Pine

(CF#257)B. Jzzhu and Sequences