CSES - Datatähti 2021 alku - Results
Submission details
Task:Sanalista
Sender:Lizene
Submission time:2020-10-11 01:19:32 +0300
Language:Python2 (PyPy2)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.04 sdetails
#20.04 sdetails
#30.04 sdetails

Code

n,k=map(int,raw_input().split( ))
l=map(int, raw_input().split( ))
alitaulukot=[]
for i in range(len(l)+1):
    for j in range(i+1,len(l)+1):
        alitaulukko=l[i:j]
        alitaulukot.append(alitaulukko)
vastaus=0
for i in alitaulukot:
    if max(i)-min(i)<=k:
        vastaus+=1
print vastaus



Test details

Test 1

Verdict:

input
1000
korvata
sopimusaika
nuhatartunta
korttiautomaatti
...

correct output
15

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n,k=map...

Test 2

Verdict:

input
1000
pub
hansikaslokero
erikoisvalmisteinen
unijukka
...

correct output
42

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n,k=map...

Test 3

Verdict:

input
1000
haapalastu
toipumisaika
mustalaiskieli
taidelainaamo
...

correct output
70

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    n,k=map...