给一个checker
查看原帖
给一个checker
89667
SentoAyaka楼主2023/2/23 21:16
int n,x,y,num;char c;stack<int>B[10][10];
void MAIN(){
	n=read();for(int i=1;i<=n;i++)B[1][1].push(read());
	while(scanf("%d %d %c %d",&x,&y,&c,&num)!=EOF){
		if(c=='R'){
			stack<int>A;for(int i=1;i<=num;i++)A.push(B[x][y].top()),B[x][y].pop();
			while(!A.empty())B[x][y+1].push(A.top()),A.pop();
		}
		else {
			stack<int>A;for(int i=1;i<=num;i++)A.push(B[x][y].top()),B[x][y].pop();
			while(!A.empty())B[x+1][y].push(A.top()),A.pop();
		}
	}
	cout<<B[6][6].size()<<"\n";
	while(!B[6][6].empty())cout<<B[6][6].top()<<' ',B[6][6].pop();
}
2023/2/23 21:16
加载中...