社区讨论
求大佬改错,为什么只有六十分?
P1328[NOIP 2014 提高组] 生活大爆炸版石头剪刀布参与者 3已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @mi7ci15p
- 此快照首次捕获于
- 2025/11/20 19:25 4 个月前
- 此快照最后确认于
- 2025/11/20 19:25 4 个月前
求大佬改错,为什么只有六十分??
CPP#include<iostream>
#include<cstdio>
using namespace std;
const int N=205;
int ans1=0,ans2=0;
int q=0,w=0;
const int rps[5][5]= {0,0,1,1,0,
1,0,0,1,0,
0,1,0,0,1,
0,0,1,0,1,
1,1,0,0,0
};
int n,a,b;
int aa[N],bb[N];
int main()
{
// freopen("rps.in","r",stdin);
// freopen("rps.out","w",stdout);
cin>>n>>a>>b;
for(int i=1; i<=a; i++)
cin>>aa[i];
for(int i=1; i<=b; i++)
cin>>bb[i];
while(n!=0)
{
q++;
q%=a;
w++;
w%=b;
ans1+=rps[aa[q]][bb[w]];
ans2+=rps[bb[w]][aa[q]];
n--;
}
cout<<ans1<<" "<<ans2;
return 0;
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...