← Back to List

1159번: 농구 경기 ↗

Solutions

C++14
306 B | 306 chars
#include <iostream>
#include <string>
using namespace std;
int N,c=1,C[500];
string a[200];
int main()
{
	cin>>N;
	for(int x=0; x<N; x++) cin>>a[x];
	for(int x=0; x<N; x++)
	{
		C[a[x][0]]++;
	}
	for(int x='a'; x<'z'+1; x++)
	{
		if(C[x]>4)
		{
			cout<<(char)x;
			c=0;
		}
	}
	if(c==1) cout<<"PREDAJA";
}