1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 11 using namespace std;12 13 int main()14 {15 int listLength;16 int tol = 1;17 while(cin >> listLength)18 {19 if(listLength==0)20 break;21 22 vector correctList;23 vector correctHash (10,0);24 for(int i = 0; i < listLength; i ++)25 {26 int tmp;27 cin >> tmp;28 correctList.emplace_back(tmp);29 correctHash[tmp] ++;30 }31 32 cout << "Game " << tol++ << ":" << endl;33 while(1)34 {35 vector guessHash (10,0);36 int A = 0,B = 0;37 int flag = 0;38 for(int i = 0; i < listLength; i ++)39 {40 int tmp;41 cin >> tmp;42 if(tmp==0)43 {44 flag = 1;45 }46 else47 {48 if(tmp==correctList[i])49 A ++;50 guessHash[tmp] ++;51 }52 }53 if(flag)54 break;55 for(int i = 1; i <= 9; i ++)56 {57 B += min(correctHash[i],guessHash[i]);58 }59 cout << " (" << A << "," << B-A << ")" << endl;60 }61 }62 return 0;63 }