Skip to content

Instantly share code, notes, and snippets.

@joaogui1
Created May 17, 2016 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaogui1/3375f7993f78c061b52250f48a69fec5 to your computer and use it in GitHub Desktop.
Save joaogui1/3375f7993f78c061b52250f48a69fec5 to your computer and use it in GitHub Desktop.
#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