比赛 2026郑轻校赛 评测结果 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
题目名称 我要验骰 最终得分 100
用户昵称 梦那边的美好ME 运行时间 0.185 s
代码语言 C++ 内存使用 3.80 MiB
提交时间 2026-04-07 19:18:49
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll f,b,l,r,u,d;
ll n;
string s;

int main(){
    freopen("dice.in","r",stdin);
    freopen("dice.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>f>>b>>l>>r>>u>>d;
    cin>>n;
    cin>>s;
    for (int i=0;i<n;i++){
        char op=s[i];
        ll nf=f,nb=b,nl=l,nr=r,nu=u,nd=d;
        if (op=='F'){
            f=nu;
            d=nf;
            b=nd;
            u=nb;
        }else if (op=='B'){
            f=nd;
            u=nf;
            b=nu;
            d=nb;
        }else if (op=='L'){
            l=nu;
            d=nl;
            r=nd;
            u=nr;
        }else if (op=='R'){
            r=nu;
            d=nr;
            l=nd;
            u=nl;
        }
    }
    cout<<d;
    return 0;
}