Task: | Ositus |
Sender: | Lizene |
Submission time: | 2021-10-17 19:42:47 +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.05 s | 2, 3 | details |
#6 | WRONG ANSWER | 0.56 s | 3 | details |
#7 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
jono_o = input() alphabet = "abcdefghijklmnopqrstuvxyz" x = 0 def find_all(string, character): indexes = [] for i, c in enumerate(string): if c == character: indexes.append(i) return indexes for k in alphabet: jono = jono_o if jono.count(k)>1: ind = find_all(jono, k) p = 0 for h in range(jono.count(k)-1): x += 2**(len(jono[:ind[h]])+len(jono[ind[h+1]+1:])) varasto = "" virheet = 0 taso = 1 jono = jono_o hik = True jik = True olivirhe = False while taso < 10: ensivirhe = -1 while hik == True: for i, k in enumerate(jono[ensivirhe+1:], start=ensivirhe+1): if varasto.count(k)>=1: virheet += 1 if virheet == 1: ind = find_all(jono[:i], k) ensivirhe = ind[-1] varasto = varasto + k if virheet > taso: x -= 2**(len(jono[:ensivirhe])+len(jono[i+1:])) if olivirhe == False: olivirhe = True break if i == len(jono)-1: hik = False varasto = "" virheet = 0 hik = True if olivirhe == False: break olivirhe = False taso += 1 vastaus = 2**(len(jono_o)-1)-x print(vastaus%(10**9+7))
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 |
---|
165 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
aaxxxxxxaa |
correct output |
---|
4 |
user output |
---|
999999766 |
Test 5
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
mfyzvoxmppoxcvktmcjkryyocfweub... |
correct output |
---|
643221148 |
user output |
---|
175355040 |
Test 6
Group: 3
Verdict: WRONG ANSWER
input |
---|
weinscqmmpgbrlboocvtbptgbahmwv... |
correct output |
---|
831644159 |
user output |
---|
397384192 |
Test 7
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
sxaoxcyrjoeieyinaqxwukgzdnhhsw... |
correct output |
---|
816016015 |
user output |
---|
(empty) |