#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 生活大爆炸版石头剪刀布】
最新推荐文章于 2024-05-31 15:03:06 发布