Task: | Bit Strings |
Sender: | Piltit |
Submission time: | 2019-05-25 11:45:18 +0300 |
Language: | Python3 |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.04 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | WRONG ANSWER | 0.03 s | details |
#6 | WRONG ANSWER | 0.05 s | details |
#7 | WRONG ANSWER | 0.05 s | details |
#8 | WRONG ANSWER | 0.04 s | details |
#9 | WRONG ANSWER | 0.05 s | details |
#10 | WRONG ANSWER | 0.05 s | details |
#11 | TIME LIMIT EXCEEDED | -- | details |
#12 | TIME LIMIT EXCEEDED | -- | details |
#13 | TIME LIMIT EXCEEDED | -- | details |
#14 | TIME LIMIT EXCEEDED | -- | details |
#15 | TIME LIMIT EXCEEDED | -- | details |
#16 | TIME LIMIT EXCEEDED | -- | details |
#17 | TIME LIMIT EXCEEDED | -- | details |
#18 | TIME LIMIT EXCEEDED | -- | details |
Code
P = int(1e9+7); d = [1]; n, k = map(int, input().split()) for i in range(1, n+1): if i <= k: d.append(int(2**i)%P) else: d.append((d[i-1]*2%P - d[i-k-1]%P)%P) print(d[n]);
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1 1 |
correct output |
---|
1 |
user output |
---|
2 |
Test 2
Verdict: WRONG ANSWER
input |
---|
2 1 |
correct output |
---|
1 |
user output |
---|
3 |
Test 3
Verdict: WRONG ANSWER
input |
---|
2 2 |
correct output |
---|
3 |
user output |
---|
4 |
Test 4
Verdict: WRONG ANSWER
input |
---|
3 1 |
correct output |
---|
1 |
user output |
---|
4 |
Test 5
Verdict: WRONG ANSWER
input |
---|
3 2 |
correct output |
---|
5 |
user output |
---|
7 |
Test 6
Verdict: WRONG ANSWER
input |
---|
3 3 |
correct output |
---|
7 |
user output |
---|
8 |
Test 7
Verdict: WRONG ANSWER
input |
---|
4 1 |
correct output |
---|
1 |
user output |
---|
5 |
Test 8
Verdict: WRONG ANSWER
input |
---|
4 2 |
correct output |
---|
8 |
user output |
---|
12 |
Test 9
Verdict: WRONG ANSWER
input |
---|
4 3 |
correct output |
---|
13 |
user output |
---|
15 |
Test 10
Verdict: WRONG ANSWER
input |
---|
4 4 |
correct output |
---|
15 |
user output |
---|
16 |
Test 11
Verdict: TIME LIMIT EXCEEDED
input |
---|
654321 123456 |
correct output |
---|
796245691 |
user output |
---|
(empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 1 |
correct output |
---|
1 |
user output |
---|
(empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 10 |
correct output |
---|
256933600 |
user output |
---|
(empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 100 |
correct output |
---|
142013415 |
user output |
---|
(empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 1000 |
correct output |
---|
899626120 |
user output |
---|
(empty) |
Test 16
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 10000 |
correct output |
---|
374265948 |
user output |
---|
(empty) |
Test 17
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 100000 |
correct output |
---|
388134512 |
user output |
---|
(empty) |
Test 18
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 1000000 |
correct output |
---|
235042058 |
user output |
---|
(empty) |