#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
int N,jwin=0,ywin=0;
cin>>N;
int k=N;
vector<int> v[2];//012 BCJ
v[0].resize(3);
v[1].resize(3);
while(k--)
{
char a,b;
cin>>a>>b;
if(a=='B' && b=='C')
{
jwin++;
v[0][0]++;
}
else if(a=='B' && b=='J')
{
ywin++;
v[1][2]++;
}
else if(a=='C' && b=='J')
{
jwin++;
v[0][1]++;
}
else if(a=='C' && b=='B')
{
ywin++;
v[1][0]++;
}
else if(a=='J' && b=='B')
{
jwin++;
v[0][2]++;
}
else if(a=='J' && b=='C')
{
ywin++;
v[1][1]++;
}
}
cout<<jwin<<" "<<N-jwin-ywin<<" "<<ywin<<endl;
cout<<ywin<<" "<<N-jwin-ywin<<" "<<jwin<<endl;
int maxjia=v[0][0]>=v[0][1]?0:1;
maxjia=v[0][maxjia]>=v[0][2]?maxjia:2;
int maxyi=v[1][0]>=v[1][1]?0:1;
maxyi=v[1][maxyi]>=v[1][2]?maxyi:2;
string s="BCJ";
cout<<s[maxjia]<<" "<<s[maxyi];
return 0;
}
PAT乙级 1018 锤子剪刀布
最新推荐文章于 2022-08-16 23:28:46 发布