【模拟】洛谷 P1328 NOIP2014提高组 day1 T1 生活大爆炸版石头剪刀布

把所有情况打表,然后随便暴力。

 #include<cstdio>
using namespace std;
int n,an,bn,p1,p2;
int a[],b[];
bool f[][];
int ans1,ans2;
void init()
{
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
f[][]=; f[][]=;
}
int main()
{
scanf("%d%d%d",&n,&an,&bn);
init();
for(int i=;i<=an;i++) scanf("%d",&a[i]);
for(int i=;i<=bn;i++) scanf("%d",&b[i]);
for(int i=;i<=n;i++)
{
p1++; p2++;
if(p1>an) p1=;
if(p2>bn) p2=;
ans1+=f[a[p1]][b[p2]];
ans2+=f[b[p2]][a[p1]];
}
printf("%d %d\n",ans1,ans2);
return ;
}
上一篇:Android项目---LayoutParams


下一篇:2632: [neerc2011]Gcd guessing game