比赛 2026郑轻校赛 评测结果 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
题目名称 我要验骰 最终得分 100
用户昵称 dream 运行时间 0.186 s
代码语言 C++ 内存使用 3.81 MiB
提交时间 2026-04-07 18:41:12
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
struct node{
	int a,b,c,d,e,f;
}x;
int n;
string s;
void F(){
	node y=x;
	x={y.e,y.f,y.c,y.d,y.b,y.a};
}
void B(){
	node y=x;
	x={y.f,y.e,y.c,y.d,y.a,y.b};
}
void L(){
	node y=x;
	x={y.a,y.b,y.e,y.f,y.d,y.c};
}
void R(){
	node y=x;
	x={y.a,y.b,y.f,y.e,y.c,y.d};
}
int main(){
	freopen("dice.in","r",stdin);
	freopen("dice.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>x.a>>x.b>>x.c>>x.d>>x.e>>x.f;
	cin>>n;
	cin>>s;
	s=' '+s;
	for(int i=1;i<=n;i++){
		if(s[i]=='F') F();
		if(s[i]=='B') B();
		if(s[i]=='L') L();
		if(s[i]=='R') R();
//		cout<<x.a<<" "<<x.b<<" "<<x.c<<" "<<x.d<<" "<<x.e<<" "<<x.f<<"\n";
	}
	cout<<x.f;
	return 0;
}