From dd684349c67c988ef19707cb65e637b6906fac75 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Fri, 8 Jul 2022 19:54:42 +0200 Subject: Solved some new problems --- codechef/EquinoxStrings/main.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 codechef/EquinoxStrings/main.cpp (limited to 'codechef/EquinoxStrings/main.cpp') diff --git a/codechef/EquinoxStrings/main.cpp b/codechef/EquinoxStrings/main.cpp new file mode 100644 index 0000000..574b656 --- /dev/null +++ b/codechef/EquinoxStrings/main.cpp @@ -0,0 +1,34 @@ +#include + +using namespace std; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + string w = "EQUINOX"; + while (tt--) { + int n, a, b; + cin >> n >> a >> b; + cerr << b << endl; + long long an = 0, sa = 0; + for (int i = 0; i < n; i++) { + string s; + cin >> s; + if(w.find(s[0]) != string::npos) { + sa += a; + } else { + an += b; + } + } + cerr << an << " " << sa << endl; + if (an > sa) { + cout << "ANURADHA" << endl; + } else if(an < sa) { + cout << "SARTHAK" << endl; + } else { + cout << "DRAW" << endl; + } + } +} -- cgit v1.2.3