@[bj12z_yuyangzi](/user/757204)
```
if(b[i%nb]==4||b[i%nb]==2||b[i%nb]==3)
```
这里应该没有4的情况吧
by 编码落寞 @ 2023-02-07 16:54:13
@[编码落寞](/user/557751) 改了,只过了两组
by bj12z_yuyangzi @ 2023-02-07 17:50:04
@[bj12z_yuyangzi](/user/757204)
```
if(a[i%na]==4) {
if(b[i%nb]==1) {
ap++;
}
if(b[i%nb]==3||b[i%nb]==0||b[i%nb]==2)bp++;
}
```
同理,这里好像也不对,不知道你改没改
by 编码落寞 @ 2023-02-08 08:13:51
```
#include<bits/stdc++.h>
using namespace std;
int Na1[205],Nb1[205];//周期列举
int Na2[205],Nb2[205];//实际次数全部枚举
bool cmp(int a,int b)
{
if(a==b)
{
return true;
}
if(a==0)//A出剪刀
{
if(b==1)
{
return false;
}
else if(b==2)
{
return true;
}
else if(b==3)
{
return true;
}
else if(b==4)
{
return false;
}
}
else if(a==1)//A出石头
{
if(b==0)
{
return true;
}
else if(b==2)
{
return false;
}
else if(b==3)
{
return true;
}
else if(b==4)
{
return false;
}
}
else if(a==2)//A出布
{
if(b==0)
{
return false;
}
else if(b==1)
{
return true;
}
else if(b==3)
{
return false;
}
else if(b==4)
{
return true;
}
}
else if(a==3)//A出蜥蜴人
{
if(b==0)
{
return false;
}
else if(b==1)
{
return false;
}
else if(b==2)
{
return true;
}
else if(b==4)
{
return true;
}
}
else if(a==4)//A出斯波克
{
if(b==0)
{
return true;
}
else if(b==1)
{
return true;
}
else if(b==2)
{
return false;
}
else if(b==3)
{
return false;
}
}
}
//剪刀>蜥蜴人
//石头>蜥蜴人
//布<蜥蜴人
//斯波克<蜥蜴人
///////////////////
//剪刀<斯波克
//石头<斯波克
//布>斯波克
//蜥蜴人>斯波克
int main()
{
int N,Na,Nb;
int suma=0,sumb=0;
cin>>N>>Na>>Nb;
for(int i=1;i<=Na;i++)
{
cin>>Na1[i];
}
for(int i=1;i<=Nb;i++)
{
cin>>Nb1[i];
}
for(int i=1,j=1;i<=N;i++,j++)
{
if(j>Na)
{
j=1;
Na2[i]=Na1[j];
}
Na2[i]=Na1[j];
}
for(int i=1,j=1;i<=N;i++,j++)
{
if(j>Nb)
{
j=1;
Nb2[i]=Nb1[j];
}
Nb2[i]=Nb1[j];
}
for(int i=1;i<=N;i++)
{
if(cmp(Na2[i],Nb2[i])==1)
{
if(Na2[i]!=Nb2[i])
suma++;
}
else if(cmp(Na2[i],Nb2[i])==0)
{
sumb++;
}
}
cout<<suma<<" ";
cout<<sumb<<endl;
return 0;
}
```
by Accepted_please @ 2023-03-21 19:01:12