Task: | Ositus |
Sender: | Lexa_ft |
Submission time: | 2021-10-16 19:33:31 +0300 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.04 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.04 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.04 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.04 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.06 s | 2, 3 | details |
#6 | WRONG ANSWER | 0.29 s | 3 | details |
#7 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
def funct(nu): return 2**(nu-1) rawin=input() wordl=len(rawin) pp=funct(wordl) val=pp dupedict={} rangdict={} 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): ranges=[] for i in range(len(dlist)-1): start.append(int(dlist[i])) stop.append(int(dlist[i+1])) ranges.append(stop[-1]-start[-1]+1) rangdict[ke]=ranges for i in range(len(start)): yeetus+=funct(wordl-(stop[i]-start[i])) for j in range(len(start)): if(start[j]>start[i] and start[j]<stop[i]): addative+=1 for k1 in rangdict: for k2 in rangdict: if(k1!=k2): l1=rangdict[k1] l2=rangdict[k2] for i in range(len(l1)): for j in range(len(l2)): if(l1[i]+l2[j]<=wordl): addative+=1 output=(val+addative-yeetus)%(10**9+7) print(output)
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
a |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
abcdefghij |
correct output |
---|
512 |
user output |
---|
512 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
abcabaacbc |
correct output |
---|
120 |
user output |
---|
999999871 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
aaxxxxxxaa |
correct output |
---|
4 |
user output |
---|
999998758 |
Test 5
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
mfyzvoxmppoxcvktmcjkryyocfweub... |
correct output |
---|
643221148 |
user output |
---|
603711675 |
Test 6
Group: 3
Verdict: WRONG ANSWER
input |
---|
weinscqmmpgbrlboocvtbptgbahmwv... |
correct output |
---|
831644159 |
user output |
---|
461085829 |
Test 7
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
sxaoxcyrjoeieyinaqxwukgzdnhhsw... |
correct output |
---|
816016015 |
user output |
---|
(empty) |