#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int n,cnt=0;
while(cin>>n)
{
if(n==0) break;
++cnt;
cout<<"Game "<<cnt<<":"<<endl;
int ans[1010]={};
for(int i=1;i<=n;i++)
cin>>ans[i];
while(1)
{
int a[1010]={},ans1[1010]={};
for(int i=1;i<=n;i++)
{
cin>>a[i];
ans1[i]=ans[i];
}
if(a[1]==0) break;
int cnt1=0,cnt2=0;
for(int i=1;i<=n;i++)
{
if(a[i]==ans1[i])
{
ans1[i]=a[i]=0;
++cnt1;
}
}
for(int i=1;i<=n;i++)
{
if(a[i]==0) continue;
for(int j=1;j<=n;j++)
{
if(ans1[j]==0) continue;
if(a[i]==ans1[j])
{
a[i]=ans1[j]=0;
++cnt2;
}
}
}
printf(" (%d,%d)\n",cnt1,cnt2);
}
}
}
UVa-340 Master-Mind Hints
最新推荐文章于 2022-09-28 23:22:13 发布