-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchap1.cpp
129 lines (113 loc) · 2.96 KB
/
chap1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* FILE: chap1.cpp
* @author: Arafat Hasan Jenin <opendoor.arafat[at]gmail[dot]com>
* LINK:
* https://www.facebook.com/codingcompetitions/hacker-cup/2021/qualification-round/problems/A1
* DATE CREATED: 29-08-21 16:21:35 (+06)
* LAST MODIFIED: 29-08-21 16:21:44 (+06)
* VERDICT:
* VERSION: 1.0
* DESCRIPTION: Deleted code is debugged code.
*/
#include <stdint.h> //uint32_t
#include <unistd.h> // unsigned int sleep(unsigned int seconds);
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator> // std::istream_iterator
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
typedef double lf;
typedef long double llf;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<long long> vl;
#define _USE_MATH_DEFINES
#define forr(i, a, b) for (__typeof(a) i = (a); i <= (b); i++)
#define rof(i, b, a) for (__typeof(a) i = (b); i >= (a); i--)
#define rep(i, n) for (__typeof(n) i = 0; i < (n); i++)
#define forit(i, s) \
for (__typeof((s).end()) i = (s).begin(); i != (s).end(); ++i)
#define all(ar) ar.begin(), ar.end()
#define fill(a, val) memset((a), (val), sizeof((a)))
#define clr(a) memset((a), 0, sizeof((a)))
#define sz(a) (int)a.size()
#define pb push_back
#ifndef ONLINE_JUDGE
#define nl cerr << '\n'
#define sp cerr << ' '
#define ckk cerr << "###############\n"
#define debug1(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) \
cerr << #x << ": " << (x) << '\t' << #y << ": " << (y) << '\n'
#define debug3(x, y, z) \
cerr << #x << ": " << (x) << '\t' << #y << ": " << (y) << '\t' << #z << ": " \
<< (z) << '\n'
#else
#define nl
#define sp
#define ckk
#define debug1(x)
#define debug2(x, y)
#define debug3(x, y, z)
#endif
#define PI acos(-1.0)
#define INF 0x7fffffff
#define MOD 1000000007
#define EPS 1e-7
#define MAX 10000007 // 1e7+7
////////////////////////// START HERE //////////////////////////
bool isVowel(char ch) {
return ch == 'A' or ch == 'E' or ch == 'I' or ch == 'O' or ch == 'U';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
string str;
cin >> t;
while (t--) {
cin >> str;
int vowelCount = 0, consonantCount = 0;
map<char, int> freq;
int maxFreq = 0;
int maxFreqChar;
for (char ch : str) {
if (isVowel(ch))
vowelCount++;
else
consonantCount++;
freq[ch]++;
if (freq[ch] > maxFreq) {
maxFreq = freq[ch];
maxFreqChar = ch;
}
}
if(vowelCount > consonantCount){
}else if(consonantCount > vowelCount){
}
}
return 0;
}