递推的思想
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int question;cin>>question;
int n;cin>>n;//玩家数量
for(int i=0;i<n;i++)
{
string choice;cin>>choice;
int result = 1;
for(int j = 0;j<question;j++)
{
if(choice[j]=='n') result += pow(2,question-j-1);
}
cout<<result<<endl;
}
return 0;
}