Created
May 17, 2016 01:20
-
-
Save joaogui1/3375f7993f78c061b52250f48a69fec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
set <string> s; | |
map <char,int> mp; | |
string str,aux; | |
char bf[4]; | |
bool ck; | |
int main(){ | |
cin >> str; | |
int len = str.size(); | |
for(int i = 0; i < len; i+=3){ | |
bf[0] = str[i]; | |
bf[1] = str[i+1]; | |
bf[2] = str[i+2]; | |
aux = bf; | |
mp[bf[0]]++; | |
if(s.find(aux) != s.end()){ | |
ck = true; | |
break; | |
} | |
s.insert(aux); | |
} | |
if(ck)printf("GRESKA\n"); | |
else printf("%d %d %d %d\n",13-mp['P'],13-mp['K'],13-mp['H'],13-mp['T']); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment