-
Notifications
You must be signed in to change notification settings - Fork 0
/
carte.cpp
50 lines (36 loc) · 844 Bytes
/
carte.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
//
// Created by Tony on 8/14/2021.
//
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int P = 13,K = 13,H = 13,T = 13;
unordered_map<string,int> map;
for (int i = 0; i < s.length()/3; i++) {
string bui = "";
for (int j = 0; j < 3; j++) {
bui += s[i*3+j];
}
if (bui[0] == 'P')
P--;
if (bui[0] == 'K')
K--;
if (bui[0] == 'H')
H--;
if (bui[0] == 'T')
T--;
map[bui]+=1;
if (map[bui] == 2)
{
cout << "GRESKA" << endl;
return 0;
}
}
printf("%d %d %d %d",P,K,H,T);
}