diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-07-08 19:54:42 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-07-08 19:54:42 +0200 |
| commit | dd684349c67c988ef19707cb65e637b6906fac75 (patch) | |
| tree | 2fd9ac45ef08351c8164eda640dade2890f4c731 /codechef/EquinoxStrings | |
| parent | 4688ed5f3a56ac6698250e2169adbfbe53b8b685 (diff) | |
| download | competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.tar.xz competitive-programming-dd684349c67c988ef19707cb65e637b6906fac75.zip | |
Solved some new problems
Diffstat (limited to 'codechef/EquinoxStrings')
| -rw-r--r-- | codechef/EquinoxStrings/inp | 0 | ||||
| -rwxr-xr-x | codechef/EquinoxStrings/main | bin | 0 -> 30696 bytes | |||
| -rw-r--r-- | codechef/EquinoxStrings/main.cpp | 34 | ||||
| -rw-r--r-- | codechef/EquinoxStrings/main_input0.txt | 9 | ||||
| -rw-r--r-- | codechef/EquinoxStrings/main_output0.txt | 2 |
5 files changed, 45 insertions, 0 deletions
diff --git a/codechef/EquinoxStrings/inp b/codechef/EquinoxStrings/inp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/codechef/EquinoxStrings/inp diff --git a/codechef/EquinoxStrings/main b/codechef/EquinoxStrings/main Binary files differnew file mode 100755 index 0000000..ce92096 --- /dev/null +++ b/codechef/EquinoxStrings/main 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 <bits/stdc++.h> + +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; + } + } +} diff --git a/codechef/EquinoxStrings/main_input0.txt b/codechef/EquinoxStrings/main_input0.txt new file mode 100644 index 0000000..6325e0d --- /dev/null +++ b/codechef/EquinoxStrings/main_input0.txt @@ -0,0 +1,9 @@ +2 +4 1 3 +ABBBCDDE +EARTH +INDIA +UUUFFFDDD +2 5 7 +SDHHD +XOXOXOXO diff --git a/codechef/EquinoxStrings/main_output0.txt b/codechef/EquinoxStrings/main_output0.txt new file mode 100644 index 0000000..67bb96a --- /dev/null +++ b/codechef/EquinoxStrings/main_output0.txt @@ -0,0 +1,2 @@ +DRAW +ANURADHA |
