~codeforces 725B

随便找一找规律就好,基本上没有什么规律可言~

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
typedef long long LL;
typedef unsigned long long ULL;


char s[30];
int f(char c){
    if(c=='f')return 1;
    if(c=='e')return 2;
    if(c=='d')return 3;
    if(c=='a')return 4;
    if(c=='b')return 5;
    if(c=='c')return 6;
}


int main()
{
    scanf("%s",s);
    int len=strlen(s);
    LL n=0;
    char c=s[len-1];
    for(int i=0;i<len-1;i++){
        n=n*10+s[i]-'0';
    }
    LL ans=0;
    ans+=((n-1)/4)*16;
    n%=2;
    n=!n;
    ans+=f(c)+n*6+n;
    printf("%I64d\n",ans);
    return 0;
}

  

 

posted @ 2016-11-03 21:25  fzfn5049  阅读(311)  评论(0编辑  收藏  举报