// 2019 IUSB Programming Competition // Round 1 Problem 5 // Give the hints for a Mastermind game // Solution by Liguo Yu #include using namespace std; int main() { int a[4]; int b[4]; for (int i = 0; i < 4; i++) cin >> a[i]; for (int i = 0; i < 4; i++) cin >> b[i]; int x = 0; int y = 0; for (int i = 0; i < 4; i++) { if (a[i] == b[i]) x++; } for (int i = 0; i < 4; i++) { for(int j=0; j<4; j++) { if(i!=j && a[i] == b[j]) y++; } } cout << x << " " << y; return 0; }