Submission #382129

#TimeUsernameProblemLanguageResultExecution timeMemory
382129BlancaHMKarte (COCI15_karte)C++14
50 / 50
1 ms492 KiB
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	string S;
	cin >> S;
	map<char, vector<bool>> cards;
	cards['P'] = vector<bool>(13, false);
	cards['K'] = vector<bool>(13, false);
	cards['H'] = vector<bool>(13, false);
	cards['T'] = vector<bool>(13, false);
	bool greska = false;
	for (int i = 0; i < (int) S.size(); i += 3) {
		int cardsNum = (S[i+1]-'0')*10 + S[i+2]-'0';
		if (cards[S[i]][cardsNum - 1]) {
			greska = true;
			break;
		}
		cards[S[i]][cardsNum-1] = true;
	}
	if (greska)
		cout << "GRESKA";
	else {
		cout << count(cards['P'].begin(), cards['P'].end(), false);
		cout << " " << count(cards['K'].begin(), cards['K'].end(), false);
		cout << " " << count(cards['H'].begin(), cards['H'].end(), false);
		cout << " " << count(cards['T'].begin(), cards['T'].end(), false);
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...