CSES - Datatähti 2016 alku - Results
Submission details
Task:Osajono
Sender:as
Submission time:2015-10-01 18:31:20
Language:Python2
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.05 s1details
#20.06 s1details
#30.06 s1details
#40.06 s1details
#50.06 s1details
#60.06 s2details
#70.05 s2details
#80.06 s2details
#90.06 s2details
#100.05 s2details
#110.05 s3details
#120.06 s3details
#130.05 s3details
#140.06 s3details
#150.05 s3details

Code

#Teht. 1 - Osajono

def osajono(jono):
    total = 0
    letterdict = {'A': 0, 'B': 0, 'C': 0, 'D': 0, 'E': 0, 'F': 0, 'G': 0, 'H': 0,
                  'I': 0, 'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 0, 'P': 0,
                  'Q': 0, 'R': 0, 'S': 0, 'T': 0, 'U': 0, 'V': 0, 'W': 0, 'X': 0,
                  'Y': 0, 'Z': 0}
    for k in jono:
        letterdict[k] += 1
    for m in letterdict.values():
        m = ((m + 1) * m) / 2
        total += m
    print letterdict.values()
    return total


jono = raw_input()
print int(osajono(jono))
    
    
    

Test details

Test 1

Group: 1

Verdict:

input
BBBAABBBAAAABBAAAABAABAABBBBBB...

correct output
2554

user output
[48, 0, 52, 0, 0, 0, 0, 0, 0, ...

Test 2

Group: 1

Verdict:

input
GDFVYWQCZAFGICSXOSWBZMGPDBSSVL...

correct output
299

user output
[2, 4, 2, 4, 5, 3, 6, 4, 3, 3,...

Test 3

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAZAAAA...

correct output
4314

user output
[92, 0, 0, 0, 0, 0, 0, 0, 0, 0...

Test 4

Group: 1

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4231

user output
[91, 0, 0, 0, 0, 0, 0, 0, 0, 0...

Test 5

Group: 1

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5050

user output
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...

Test 6

Group: 2

Verdict:

input
BBABABBBABBAABBABBABAABAAABABA...

correct output
6253029

user output
[2477, 0, 2523, 0, 0, 0, 0, 0,...

Test 7

Group: 2

Verdict:

input
RBKJMLDVQMKHYKCNDIVVKOMFUXTFMG...

correct output
485173

user output
[205, 208, 199, 182, 186, 176,...

Test 8

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12427725

user output
[4985, 0, 0, 0, 0, 0, 0, 0, 0,...

Test 9

Group: 2

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
12467549

user output
[4993, 0, 0, 0, 0, 0, 0, 0, 0,...

Test 10

Group: 2

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
12502500

user output
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...

Test 11

Group: 3

Verdict:

input
BAAAAABABBABAABAABABABBBABBAAB...

correct output
2500051369

user output
[50037, 0, 49963, 0, 0, 0, 0, ...

Test 12

Group: 3

Verdict:

input
ABBURXDRVXAYBPXXOQZNYHLWGUEEWR...

correct output
192407124

user output
[3818, 3895, 3738, 3849, 3812,...

Test 13

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998050400

user output
[99980, 0, 0, 0, 0, 0, 0, 0, 0...

Test 14

Group: 3

Verdict:

input
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

correct output
4998850144

user output
[99988, 0, 0, 0, 0, 0, 0, 0, 0...

Test 15

Group: 3

Verdict:

input
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ...

correct output
5000050000

user output
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...