-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsol.cpp
More file actions
executable file
·74 lines (68 loc) · 1.46 KB
/
Copy pathsol.cpp
File metadata and controls
executable file
·74 lines (68 loc) · 1.46 KB
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
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<bool> P(14, false);
vector<bool> K(14, false);
vector<bool> H(14, false);
vector<bool> T(14, false);
char s;
int n;
while (cin >> s >> n)
{
if (s == 'P')
{
if (P[n])
{
cout << "GRESKA" << endl;
return 0;
}
else
{
P[n] = true;
}
}
else if (s == 'K')
{
if (K[n])
{
cout << "GRESKA" << endl;
return 0;
}
else
{
K[n] = true;
}
}
else if (s == 'H')
{
if (H[n])
{
cout << "GRESKA" << endl;
return 0;
}
else
{
H[n] = true;
}
}
else
{ // s == 'T'
if (T[n])
{
cout << "GRESKA" << endl;
return 0;
}
else
{
T[n] = true;
}
}
}
int sum_P = 13 - accumulate(P.begin(), P.end(), 0);
int sum_K = 13 - accumulate(K.begin(), K.end(), 0);
int sum_H = 13 - accumulate(H.begin(), H.end(), 0);
int sum_T = 13 - accumulate(T.begin(), T.end(), 0);
printf("%d %d %d %d\n", sum_P, sum_K, sum_H, sum_T);
return 0;
}