Submission #413551

# Submission time Handle Problem Language Result Execution time Memory
413551 2021-05-28T22:05:46 Z rqi Karte (COCI15_karte) C++14
50 / 50
1 ms 292 KB
#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define f first
#define s second
#define ins insert

#define sz(x) (int)(x).size()

int main(){
	string S;
	cin >> S;

	set<pair<char, int>> cards;

	map<char, int> m;
	m['P'];
	m['K'];
	m['H'];
	m['T'];
	for(int i = 0; i < sz(S); i+=3){
		pair<char, int> card = mp(S[i], stoi(to_string(S[i+1])+to_string(S[i+2])));
		if(cards.find(card) != cards.end()){
			cout << "GRESKA" << "\n";
			exit(0);
		}
		cards.ins(card);
		m[card.f]++;
	}

	for(auto &u: m){
		u.s = 13-u.s;
	}
	
	cout << m['P'] << " " << m['K'] << " " << m['H'] << " " << m['T'] << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 292 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct