| Task: | Ositus |
| Sender: | Katto |
| Submission time: | 2021-10-10 00:34:34 +0300 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.02 s | 1, 2, 3 | details |
| #2 | WRONG ANSWER | 0.02 s | 1, 2, 3 | details |
| #3 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #4 | RUNTIME ERROR | 0.02 s | 1, 2, 3 | details |
| #5 | RUNTIME ERROR | 0.02 s | 2, 3 | details |
| #6 | RUNTIME ERROR | 0.02 s | 3 | details |
| #7 | RUNTIME ERROR | 0.23 s | 3 | details |
Code
string = input()
mod = int(1e9+7)
ans = ((1 << (len(string)-1)) - 1) % mod
def finder(string, ch, count):
x = []
cuts = 0
for i in range(count):
x1 = string.find(ch)+cuts
string = string[x1+1:]
cuts += x1 + 1
x.append(x1)
return x
# Periaatteellinen vika looperissa!
# esim merkkijonon "axbxcx" tapauksessa:
# jaettu merkkijono "a|xbxcx" miinustetaan kolmesti yhden kerran sijaan.
def looper(x: str, length, mod):
sum = 0
for i in range(len(x)):
for j in range(len(x)):
if j > i:
sum = (sum + (1 << (x[i]-x[j]+length-1)) - 1) % mod
return sum
for ch in ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "m", "n", "l", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]:
if string.count(ch) > 1:
count = string.count(ch)
if count > 1:
x = finder(string, ch, count)
ans -= looper(x, len(string), mod)
print(ans)
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| a |
| correct output |
|---|
| 1 |
| user output |
|---|
| 0 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| abcdefghij |
| correct output |
|---|
| 512 |
| user output |
|---|
| 511 |
Test 3
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| abcabaacbc |
| correct output |
|---|
| 120 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 36, in <module>
ans -=...Test 4
Group: 1, 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| aaxxxxxxaa |
| correct output |
|---|
| 4 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 36, in <module>
ans -=...Test 5
Group: 2, 3
Verdict: RUNTIME ERROR
| input |
|---|
| mfyzvoxmppoxcvktmcjkryyocfweub... |
| correct output |
|---|
| 643221148 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 36, in <module>
ans -=...Test 6
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| weinscqmmpgbrlboocvtbptgbahmwv... |
| correct output |
|---|
| 831644159 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 36, in <module>
ans -=...Test 7
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| sxaoxcyrjoeieyinaqxwukgzdnhhsw... |
| correct output |
|---|
| 816016015 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 36, in <module>
ans -=...