Task: | Ositus |
Sender: | parasdata |
Submission time: | 2021-10-11 12:34:07 +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 | ACCEPTED | 0.02 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.03 s | 1, 2, 3 | details |
#3 | ACCEPTED | 0.03 s | 1, 2, 3 | details |
#4 | ACCEPTED | 0.03 s | 1, 2, 3 | details |
#5 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
#6 | TIME LIMIT EXCEEDED | -- | 3 | details |
#7 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
vastaus = 0 def next1(listt): listt[-1] += 1 listt[-2] -= 1 check_group(listt) def next2(listt): listt.append(1) listt[-2] -= 1 check_group(listt) def algorithm(listt): while listt[-1] >= 2: next2(listt) while listt[-2] != 1: next1(listt) if listt[-1] >= 2 and listt[-2] != 1: copy2 = listt.copy() algorithm(copy2) def check_group(group): global vastaus valid = True new_group = [] i = 0 for size in group: if size == 0: return sett = "" while size > 0: sett += text[i] size -= 1 i += 1 check = list(sett) if len(set(check)) < len(check): valid = False new_group.append(sett) if valid == True: vastaus += 1 text = list(str(input())) arvo = len(text) if arvo == 1: vastaus = 1 elif arvo == 2: if len(set(text)) < arvo: vastaus = 1 else: vastaus = 2 else: listt = [arvo - 1, 1] check_group(listt) next1(listt) copy = listt.copy() while True: algorithm(listt) listt = copy.copy() next1(listt) copy = listt.copy() if listt[0] == 0: break 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: WRONG ANSWER
input |
---|
abcdefghij |
correct output |
---|
512 |
user output |
---|
511 |
Test 3
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
abcabaacbc |
correct output |
---|
120 |
user output |
---|
120 |
Test 4
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
aaxxxxxxaa |
correct output |
---|
4 |
user output |
---|
4 |
Test 5
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
mfyzvoxmppoxcvktmcjkryyocfweub... |
correct output |
---|
643221148 |
user output |
---|
(empty) |
Test 6
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
weinscqmmpgbrlboocvtbptgbahmwv... |
correct output |
---|
831644159 |
user output |
---|
(empty) |
Test 7
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
sxaoxcyrjoeieyinaqxwukgzdnhhsw... |
correct output |
---|
816016015 |
user output |
---|
(empty) |