tails

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Given n and k, how many ways can n coins be tossed such that it has k tails in a row?

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

4 1
4 3
3 1
9 9
9 1
8 1
4 2
8 7
7 3
8 4
9 5
6 4
5 1
8 8
3 2
3 3
7 1
7 7
7 5
6 2
5 5
6 3
9 4
1 1
6 1
6 5
4 4
9 7
7 6
8 3
9 2
5 3
8 2
7 2
9 6
2 2
8 5
2 1
5 2
8 6
5 4
9 3
6 6
7 4
9 8

Sample output:

15
3
7
1
511
255
8
3
47
48
48
8
31
1
3
1
127
1
8
43
1
20
111
1
63
3
1
8
3
107
423
8
201
94
20
1
20
3
19
8
3
238
1
20
3

Sample input:_

11 2
19 10
12 5
6 4
16 6
18 18
12 12
18 5
17 4
14 8
14 5
3 1
13 1
2 1
7 2
7 6
3 3
6 6
17 13
8 2
6 1
19 18
13 4
11 4
9 4
4 4
15 3
14 7
16 2
14 6
15 12
15 5
15 15
17 3
14 2
16 15
19 15
4 1
13 9
8 8
19 2
16 7
19 1
18 2
12 6
11 7
16 14
19 8
18 11
12 1
9 1
12 11
15 7
18 1
16 1
15 14
19 9
10 4
7 1
8 3
13 8
2 2
15 4
17 9
16 4
18 16
14 14
13 5
8 5
16 9
18 6
11 8
10 1
12 9
10 2
9 6
5 2
17 15
15 11
10 5
12 3
19 13
10 3
17 7
13 10
18 12
14 13
7 3
9 2
5 1
11 11
13 13
9 8
16 12
6 5
5 3
17 11
8 6
1 1
18 10
19 19
15 9
17 8
18 17
16 13
11 6
10 9
18 9
15 2
18 8
12 4
14 10
9 7
17 10
16 8
18 13
12 7
16 16
9 3
19 16
14 11
15 8
19 4
11 5
19 14
7 4
12 2
9 9
11 3
17 6
18 4
19 7
17 2
15 10
18 7
16 5
13 12
19 5
19 3
17 12
18 3
13 6
15 6
13 11
6 2
11 10
4 3
17 1
4 2
12 10
10 10
5 4
17 17
16 11
10 6
15 1
7 5
3 2
19 11
17 16
7 7
16 3
10 8
13 3
14 9
8 1
15 13
11 9
14 4
17 5
14 1
19 12
19 17
14 12
16 10
18 15
5 5
12 8
8 4
13 7
18 14
9 5
13 2
14 3
6 3
10 7
8 7
19 6
17 14
11 1

Sample output:

1815
2816
571
8
6088
1
1
58631
54648
256
2760
7
8191
3
94
3
1
1
48
201
63
3
2656
558
111
1
22159
576
62952
1275
20
5984
1
95182
15397
3
48
15
48
1
513342
2811
524287
255379
256
48
8
13294
576
4095
511
3
1279
262143
65535
3
6143
251
127
107
112
1
12199
1280
25888
8
1
1262
20
576
28240
20
1023
20
880
20
19
8
48
112
2391
256
520
6126
20
256
3
47
423
31
1
1
3
48
3
8
256
8
1
1280
1
256
2815
3
20
112
3
2816
31171
6139
1224
48
8
576
1280
112
112
1
238
20
20
576
240335
255
112
20
3719
1
1121
13152
114832
28512
126891
112
13256
12880
3
124192
402873
112
196132
575
2798
8
43
3
3
131071
8
8
1
3
1
112
48
32767
8
3
1280
3
1
46023
8
5056
112
255
8
8
5713
27553
16383
576
8
8
256
20
1
48
48
256
48
48
7582
10616
20
20
3
60320
20
2047

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1Dingledooper580.04832022/06/23 10:30:170B / 24B / 32B
2rotary-o630.04902022/06/23 23:43:000B / 30B / 29B

Ruby2 _

RankUserSizeTimeDateStatistics
1Dingledooper580.13162022/06/23 10:30:240B / 24B / 32B
2rotary-o630.13582022/06/23 23:42:470B / 30B / 29B

Perl _

RankUserSizeTimeDateStatistics
1tails640.03212022/06/22 17:27:160B / 22B / 39B

Python3 _

RankUserSizeTimeDateStatistics
1orthoplex870.23252022/06/12 01:37:140B / 47B / 40B
2AlephSquirrel960.10422022/06/23 01:21:020B / ?B / ?B

J _

RankUserSizeTimeDateStatistics
1Frowny450.06702022/06/12 05:03:230B / ?B / ?B

C _

RankUserSizeTimeDateStatistics
1tails1000.03512022/06/24 11:01:490B / 44B / 56B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck7800.16512022/06/13 03:42:090B / 557B / 28B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails800.36112022/06/13 10:59:410B / 32B / 40B
2McBusLuck4660.16432022/06/13 03:52:410B / 222B / 126B

dc _

RankUserSizeTimeDateStatistics
1tails660.04272022/06/13 15:36:500B / 47B / 19B
2orthoplex690.10452022/06/12 03:44:0515B / 33B / 21B
3tails (Dingledooper.rb)460.05052022/06/25 22:23:000B / 29B / 17B

GolfScript _

RankUserSizeTimeDateStatistics
1tails340.12072022/06/20 15:28:580B / 8B / 26B
2lynn361.53572022/06/19 01:45:190B / 9B / 27B
3tails (Dingledooper.rb)320.10132022/06/25 22:04:020B / 8B / 24B

gs2 _

RankUserSizeTimeDateStatistics
1tails290.20362022/06/20 16:20:2514B / 9B / 4B
2tails (Dingledooper.rb)230.20312022/06/25 21:05:317B / 9B / 7B

Nibbles _

RankUserSizeTimeDateStatistics
1tails160.04252022/06/20 14:14:239B / 5B / 1B
2tails (Dingledooper.rb)150.03002022/06/25 21:45:206B / 7B / 1B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o1157.87762022/06/22 08:22:520B / 67B / 42B

Language Ranking_

RankLangUserSizeScore
1Nibblestails (Dingledooper.rb)1510000
2gs2tails (Dingledooper.rb)236521
3GolfScripttails (Dingledooper.rb)324687
4JFrowny453333
5dctails (Dingledooper.rb)463260
6RubyDingledooper582586
7Ruby2Dingledooper582586
8Perltails642343
9Bash (builtins)tails801875
10Python3orthoplex871724
11Ctails1001500
12Scalarotary-o1151304
13BashMcBusLuck780192

return to the top page