From a92e2474ba2cc3b95e9b3dc7c7b580b35e0f3220 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 23 May 2022 22:46:19 +0800 Subject: [PATCH] A - Game with Cards https://codeforces.com/contest/1681/submission/158159185 --- Codeforces/1681/A/A.cpp | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Codeforces/1681/A/A.cpp diff --git a/Codeforces/1681/A/A.cpp b/Codeforces/1681/A/A.cpp new file mode 100644 index 00000000..e6bcce71 --- /dev/null +++ b/Codeforces/1681/A/A.cpp @@ -0,0 +1,47 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +const int N = 55; + +int t, n, m; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> t; + + while (t--) { + int x1 = 0, x2 = 0; + cin >> n; + + for (int i = 1, x; i <= n; i++) { + cin >> x; + + x1 = std::max(x, x1); + } + + cin >> m; + + for (int i = 1, x; i <= m; i++) { + cin >> x; + + x2 = std::max(x, x2); + } + + if (x1 > x2) { + cout << "Alice" << endl + << "Alice" << endl; + } else if (x1 < x2) { + cout << "Bob" << endl + << "Bob" << endl; + } else { + cout << "Alice" << endl + << "Bob" << endl; + } + } + + return 0; +}