CSES - Datatähti 2019 alku - Results
Submission details
Task:Sanalista
Sender:SeveriK
Submission time:2018-10-07 23:27:44 +0300
Language:text
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttimescore
#10.00 s0details

Code

# Python3

splitInput = input().split()
n = int(splitInput[0])
k = int(splitInput[1])

splitInput = input().split()
inputs = []
difNums = []

i = int(0)
while i < n:
    inputs.append(int(splitInput[i]))
    if difNums.count(inputs[i]) == 0:
        difNums.append(inputs[i])
    i += 1

output = int(0)
o = int(0)
p = int(0)

if difNums >= k:
    while o < n:
        while p < n:
            if difNums.count(inputs[p]) == 0:
                difNums.append(inputs[p])
            output += 1
            p += 1
            if len(difNums) > k:
                output -= 1
                difNums.clear()
                p = n
        o += 1
        p = o
        difNums.clear()
else:
    output = n * (n+1) / 2

print(output)

Test details

Test 1

Verdict:

input
aakkonen
aakkosellinen
aakkosellisesti
aakkosellisuus
aakkosittain
...

correct output
(empty)

user output
# Python3

splitInput = input().split()
n = int(splitInput[0])
k = int(splitInput[1])
...