蒟蒻的第一篇题解,管理员求过
思路
跟大佬 Rosing 的思路差不多。
用两个变量存H和V出现的次数,然后取模 再输出就行了。话说为什么分数是15啊
AC code
#include<bits/stdc++.h>
using namespace std;
string s;
int n,m;
int main(){
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='H')n++;
if(s[i]=='V')m++;
}
n%=2;
m%=2;
if(n==0&&m==0)cout<<"1 2\n3 4";
else if(n==1&&m==0)cout<<"3 4\n1 2";
else if(n==0&&m==1)cout<<"2 1\n4 3";
else cout<<"4 3\n2 1";
return 0;
}如有问题可在评论区留言,感谢大家阅读!