CSES - Datatähti 2022 alku - Results
Submission details
Task:Ositus
Sender:Lexa_ft
Submission time:2021-10-16 18:46:13 +0300
Language:Python3 (PyPy3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.04 s1, 2, 3details
#20.04 s1, 2, 3details
#30.04 s1, 2, 3details
#40.04 s1, 2, 3details
#50.17 s2, 3details
#6--3details
#7--3details

Code

def funct(nu):
    return 2**(nu-1)


rawin=input()
wordl=len(rawin)
pp=funct(wordl)
print("pp:",pp)
val=pp
dupedict={}
shr=[]
start=[]
stop=[]
yeetus=0
addative=0


for i in range(wordl):
    x=rawin[i]
    if(x in dupedict.keys()):
        continue
    else:
        dlist=[]
        n=0
        while(True):
            m=rawin.find(x,n)
            if(m==-1):
                break
            dlist.append(m)
            n=m+1
        dupedict[x]=dlist


for ke in dupedict:
    dlist=dupedict[ke]
    if(len(dlist)>1):
        for i in range(len(dlist)-1):
            start.append(int(dlist[i]))
            stop.append(int(dlist[i+1]))


for i in range(len(start)):
    print("to funct:",(wordl-(stop[i]-start[i])))
    yeetus+=funct(wordl-(stop[i]-start[i]))
    print("yeet:",yeetus)
    for j in range(len(start)):
        for k in range(len(start)):
            if(start[j]>start[i] and start[j]<stop[k]):
                addative+=1
                print("add:",addative)

val=val+addative-yeetus

print(val)

Test details

Test 1

Group: 1, 2, 3

Verdict:

input
a

correct output
1

user output
pp: 1
1

Test 2

Group: 1, 2, 3

Verdict:

input
abcdefghij

correct output
512

user output
pp: 512
512

Test 3

Group: 1, 2, 3

Verdict:

input
abcabaacbc

correct output
120

user output
pp: 512
to funct: 7
yeet: 64
add: 1
add: 2
...
Truncated

Test 4

Group: 1, 2, 3

Verdict:

input
aaxxxxxxaa

correct output
4

user output
pp: 512
to funct: 9
yeet: 256
add: 1
add: 2
...
Truncated

Test 5

Group: 2, 3

Verdict:

input
mfyzvoxmppoxcvktmcjkryyocfweub...

correct output
643221148

user output
pp: 63382530011411470074835160...
Truncated

Test 6

Group: 3

Verdict:

input
weinscqmmpgbrlboocvtbptgbahmwv...

correct output
831644159

user output
(empty)

Test 7

Group: 3

Verdict:

input
sxaoxcyrjoeieyinaqxwukgzdnhhsw...

correct output
816016015

user output
(empty)