CSES - Leirikisa 1 - Results
Submission details
Task:trener
Sender:ollpu
Submission time:2016-07-27 14:07:50 +0300
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.06 sdetails
#5ACCEPTED0.05 sdetails
#6ACCEPTED0.05 sdetails
#7ACCEPTED0.05 sdetails
#8ACCEPTED0.05 sdetails
#9ACCEPTED0.06 sdetails
#10ACCEPTED0.06 sdetails
#11ACCEPTED0.06 sdetails
#12ACCEPTED0.05 sdetails
#13ACCEPTED0.06 sdetails
#14ACCEPTED0.05 sdetails
#15ACCEPTED0.05 sdetails

Code

#include <iostream>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	int counts[26];
	for (int i = 0; i < 26; ++i) counts[i] = 0;
	bool possible = 0;
	for (int i = 0; i < n; ++i) {
		string s;
		cin >> s;
		if (++counts[s.front() - 'a'] >= 5) possible = 1;
	}
	if (possible) {
		for (int i = 0; i < 26; ++i) {
			if (counts[i] >= 5) cout << string(1, 'a'+i);
		}
	} else {
		cout << "PREDAJA";
	}
	cout << endl;
}

Test details

Test 1

Verdict: ACCEPTED

input
18
babic
keksic
boric
bukic
...

correct output
bk

user output
bk

Test 2

Verdict: ACCEPTED

input
6
michael
jordan
lebron
james
...

correct output
PREDAJA

user output
PREDAJA

Test 3

Verdict: ACCEPTED

input
10
wmyrsaney
raqdxrb
cnwkmtcokgskaxosctzyks
wlusaisfibbkwwzdqhezuj
...

correct output
w

user output
w

Test 4

Verdict: ACCEPTED

input
20
jgztazpytubijfsmjz
bokvgratzzdibku
qineboilzoqdqivc
bfctyltibtkbxq
...

correct output
b

user output
b

Test 5

Verdict: ACCEPTED

input
50
wkrtpgfjmzlnqigogi
knqkkelytfjgmyxgyzcfd
xdkjrptlcuzwqgvrtzdbybh
vscbjbji
...

correct output
efv

user output
efv

Test 6

Verdict: ACCEPTED

input
100
cmksprocpmkl
deyorcxeehlalonan
tdoqxhvygiwbbklj
rvamqpuprhynwduswppa
...

correct output
dfqrt

user output
dfqrt

Test 7

Verdict: ACCEPTED

input
130
assootmfjtgcagtxh
elqyysidg
otuxclnjhvxdadm
qmczmsgavvcboahqilzcuzm
...

correct output
abcdefghijklmnopqrstuvwxyz

user output
abcdefghijklmnopqrstuvwxyz

Test 8

Verdict: ACCEPTED

input
60
ljuolrxkieqkobvikuyvt
rhbrswllwycioayqjdertvb
xmzcubmbbed
uwgjslybqarciupgixt
...

correct output
eflmnr

user output
eflmnr

Test 9

Verdict: ACCEPTED

input
5
pnmdjqteyiapkhvebbqtwnnh
pirfyzgoqjsdsio
pkcltfhwxemgyubef
pxcjeh
...

correct output
p

user output
p

Test 10

Verdict: ACCEPTED

input
20
fnuxegvwdqnkmkclmwlxeh
kmurkl
rlhxoacqadnzle
foxonevsx
...

correct output
PREDAJA

user output
PREDAJA

Test 11

Verdict: ACCEPTED

input
81
pidkcuqljmxi
mcpwm
zyyjrvkkkwkabwppvpm
aoighmgashjtvl
...

correct output
cegiptuwx

user output
cegiptuwx

Test 12

Verdict: ACCEPTED

input
100
evyottlutpqus
openmtwnmme
yvtgrk
shhpzhlgmpnnvswcpmjqiwe
...

correct output
PREDAJA

user output
PREDAJA

Test 13

Verdict: ACCEPTED

input
99
yuqgzaqmnwrghzntlv
mcjkwfrkzchiauues
uclswdwkhtvkcsvklyhyiw
tggmfkr
...

correct output
abeklmnqtvz

user output
abeklmnqtvz

Test 14

Verdict: ACCEPTED

input
4
kzyulnmhnmkowhtgrqksru
xkgzlbwihowzdaodfg
nvxkdrltxviwyhkf
npvivwibxwrludfouga

correct output
PREDAJA

user output
PREDAJA

Test 15

Verdict: ACCEPTED

input
78
qdidvlkgpxjxmuqq
kgbugcncxazixwtxtww
abwtlqxkrusaocu
esjmgrutkzebklqt
...

correct output
ajlstxz

user output
ajlstxz