```cpp
#include <bits/stdc++.h>
using namespace std;
int sa[205],sb[205];
int A,B;
int main()
{
int n,a,b;
cin>>n>>a>>b;
for (int i=1;i<=a;i++)
{
cin>>sa[i];
}
for (int i=1;i<=b;i++)
{
cin>>sb[i];
}
for (int i=1;i<=n;i++)
{
int nowa=i%a;
int nowb=i%b;
if (nowa==0)
{
nowa=a;
}
if (nowb==0)
{
nowb=b;
}
int s1=sa[nowa],s2=sb[nowb];
if (s1==s2)
{
}
else if (s1==0)
{
if (s2==1)
{
B++;
}
else if(s2==2)
{
A++;
}
else if(s2==3)
{
A++;
}
else
{
B++;
}
}
else if (s1==1)
{
if (s2==0)
{
A++;
}
else if(s2==2)
{
B++;
}
else if(s2==3)
{
A++;
}
else
{
B++;
}
}
else if (s1==2)
{
if (s2==0)
{
B++;
}
else if(s2==1)
{
A++;
}
else if(s2==3)
{
B++;
}
else
{
A++;
}
}
else if (s1==3)
{
if (s2==0)
{
B++;
}
else if(s2==1)
{
B++;
}
else if(s2==2)
{
A++;
}
else
{
A++;
}
}
else if (s1==4)
{
if (s2==0)
{
A++;
}
else if(s2==1)
{
A++;
}
else if(s2==2)
{
B++;
}
else
{
B++;
}
}
}
cout<<A<<' '<<B;
return 0;
}
//132玄学打表代码,可供参考
```
by 二马Junco @ 2022-11-21 15:35:01
@[二马Junco](/user/510823) 谢谢,请问您知道我的代码错哪里了吗?
by Literally114514 @ 2022-11-21 15:36:55
@[liuzhixing0922](/user/638141)
ab数组开到205试试
by 二马Junco @ 2022-11-21 15:40:40
@[liuzhixing0922](/user/638141)
开到205 ac了
by 二马Junco @ 2022-11-21 15:43:07
@[二马Junco](/user/510823) what???啊啊啊调了半天
by Literally114514 @ 2022-11-21 15:44:09
破防了
by Literally114514 @ 2022-11-21 15:45:10