#include<iostream>
#include<algorithm>
#define IOS std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
using namespace std;
typedef long long ll;
int n, ta , tb , a[207] , b[207] , ans1 , ans2 , res1=1 , res2=1 ;
int q[7][7]={ {0, -1 , 1 , 1 , -1 } , { 1, 0 , -1 , 1 , -1 } , { -1 , 1 , 0 , -1 ,1 } , { -1 , -1 , 1 , 0 , 1 } , { 1 ,1 , -1 , -1 , 0 } } ;//根据题目的图得到比分表
int main () {
IOS;
cin>>n>>ta>>tb;
for(int i=1 ; i<=ta;i++)cin>>a[i];
for(int i=1;i<=tb;i++)cin>>b[i];
for(int i=0;i<n;i++){
if(q[a[res1]][b[res2]]==1)ans1++;
else if(q[a[res1]][b[res2]]==-1)ans2++;
res1++,res2++;
if(res1>ta)res1=1;
if(res2>tb)res2=1;
}
cout<<ans1<<" "<<ans2;
return 0;
}
【洛谷1328 生活大爆炸版石头剪刀布】
最新推荐文章于 2025-12-29 15:56:56 发布
本文展示了一个使用C++进行编程竞赛的例子,通过定义比分表并模拟两支队伍的比赛过程来计算最终得分。该程序利用了标准输入输出、命名空间简化及类型别名等特性。
192

被折叠的 条评论
为什么被折叠?



