From fb6689946b45d96e536164b1c4adb816570783dc Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 15 May 2022 16:39:20 +0800 Subject: [PATCH] A - Volleyball https://codeforces.com/gym/103698/submission/157276915 --- Gym/103698/A/A.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Gym/103698/A/A.cpp diff --git a/Gym/103698/A/A.cpp b/Gym/103698/A/A.cpp new file mode 100644 index 00000000..d7abd4ce --- /dev/null +++ b/Gym/103698/A/A.cpp @@ -0,0 +1,30 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int op, x, a, b, aa, bb; + +int main() { + std::ios::sync_with_stdio(false); + + while (cin >> op >> x) { + (op == 1 ? a : b) += x; + + if (std::abs(a - b) >= 2 && (a >= 25 || b >= 25)) { + cout << a << ':' << b << endl; + if (a > b) + aa++; + else + bb++; + a = 0, b = 0; + } + + if (aa + bb >= 3) break; + } + + cout << (aa < bb) + 1 << endl; + + return 0; +}