#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;
}
原文地址:https://www.cnblogs.com/dwj030917/p/10427151.html
时间: 2024-10-13 20:08:45