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

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:19:11: warning: array subscript has type 'char' [-Wchar-subscripts]
     x[s[0]]++;
           ^
input/code.cpp:20:15: warning: array subscript has type 'char' [-Wchar-subscripts]
     if (x[s[0]] == 5) c.push_back(s[0]);
               ^

Code

#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define N (1<<17)
#define M 1000000007

using namespace std;

char x[255];

int main () {
  int n;
  cin>>n;
  vector<char> c;
  
  for (int i = 0; i < n; i++) {
    string s;
    cin>>s;
    x[s[0]]++;
    if (x[s[0]] == 5) c.push_back(s[0]);
  }
  sort(c.begin(), c.end());
  if (c.empty()) cout<<"PREDAJA";
  else for (char x : c) cout<<x;
  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