CF1567A 题解(未过)
题意
Alice 有
思路
因为骨牌只有两行,所以它们一定对称。如果当前卡槽中有垂直放着的这些
注意
这又是一个多解的题目,样例对的,但不代表只能是样例!
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
for(int i=0;i<s.length();i++)
if(s[i]=='U') cout<<'D'; // 是 U 就打 D
else if(s[i]=='D') cout<<'U'; // 是 D 就打 U
else cout<<s[i];
cout<<endl; // 记得换行
}
}
AC记录(洛谷)
AC记录(CF)