CSES - Putka Open 2020 – 2/5 - Results
Submission details
Task:Torni
Sender:habla02
Submission time:2020-09-25 21:11:03 +0300
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#1--1, 2, 3details
#2--2, 3details
#3--3details

Code

#n = int(input('Anna luku'))

def facto(n):
    prod = 1
    for k in range(2,n+1):
        prod = prod * k #% ((10**9)+7)
    return prod

def binom(n, k):
    return (facto(n)/(facto(k)*(facto(n-k))))

def torni(t):
    koko = 0
    for i in range(0,t+1):
        koko += ((binom(t,i))*2*((t-i)**2))
    koko = koko-t-1
    koko = koko%((10**9)+7)
    return koko
                           

if __name__ == '__main__':
    for i in range(1000,2000):
        print(i, torni(i))
    print(torni(6))
    print(torni(2865))
    print(binom(2000,258))

Test details

Test 1

Group: 1, 2, 3

Verdict:

input
10
1
2
3
4
...

correct output
2
8
34
148
650
...

user output
(empty)

Test 2

Group: 2, 3

Verdict:

input
100
1
2
3
4
...

correct output
2
8
34
148
650
...

user output
(empty)

Test 3

Group: 3

Verdict:

input
100
996306
650655
896240
821967
...

correct output
87350005
606189151
122595036
193572715
227926807
...

user output
(empty)