-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWord.cpp
More file actions
47 lines (44 loc) · 940 Bytes
/
Copy pathWord.cpp
File metadata and controls
47 lines (44 loc) · 940 Bytes
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
// https://codeforces.com/problemset/problem/59/A
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <string>
#include <bits/stdc++.h>
#include <cstdint>
#include <map>
#include <unordered_map>
#define ll long long
#define u64 uint64_t
#define i64 int64_t
using namespace std;
void solveCase() {
string s;
cin >> s;
int freq[2];
freq[0] = 0;
freq[1] = 0;
for (int i = 0; i < s.length(); i++) {
freq[s[i]/'a']++;
}
if (freq[0] > freq[1]) {
for (int i = 0; i < s.length(); i++) {
s[i] = (s[i] >= 97) ? s[i]-32 : s[i];
}
} else {
for (int i = 0; i < s.length(); i++) {
s[i] = (s[i] >= 97) ? s[i] : s[i]+32;
}
}
cout << s << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int nC = 1;
// cin >> nC;
while (nC--) {
solveCase();
}
return 0;
}