Dice Antipodes

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

In a usual set of dice for D&D, a face of a die plus its anitpode equals n + 1, where n is the number of sides the die has. The exception to this is a d10, where they equal 9. (We are treating the 0 on d10s as 0 and not 10. Also, d4s are just weird and we're leaving them alone.)

Given the number of number of sides a die and the value on one of its sides (e.g. 6,3), print the value of the antipode of the given side.

Options

exec is denied

rejudge feature is enabled

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

Sample input:_

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

Sample output:

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

Sample input:_

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

Sample output:

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

Sample input:_

10,5
20,12
8,7
12,6
20,5
6,5
10,6
10,9
20,18
12,11
20,10
20,7
6,6
8,5
6,4
12,5
10,5
10,9
6,4
10,8
20,10
10,6
8,5
12,4
6,6
12,11
12,1
6,5
8,3
6,2
6,1
20,2
8,6
6,5
12,7
8,8
8,5
12,1
8,4
10,9
12,7
10,0
6,2
12,6
6,6
20,15
8,7
12,4
10,3
20,5
20,12
8,5
8,1
20,10
12,5
10,3
20,5
6,5
10,4
12,3
6,1
6,2
10,3
6,1
8,3
20,14
6,2
20,7
12,4
6,3
12,8
20,7
6,5
8,1
10,1
6,6
20,1
8,2
10,7
10,9
6,2
8,5
20,6
6,3
20,5
10,1
12,8
12,5
10,4
12,12
8,6
10,0
8,5
6,2
20,20
10,7
12,9
20,19
6,1
12,1
20,7

Sample output:

4
9
2
7
16
2
3
0
3
2
11
14
1
4
3
8
4
0
3
1
11
3
4
9
1
2
12
2
6
5
6
19
3
2
6
1
4
12
5
0
6
9
5
7
1
6
2
9
6
16
9
4
8
11
8
6
16
2
5
10
6
5
6
6
6
7
5
14
9
4
5
14
2
8
8
1
20
7
2
0
5
4
15
4
16
8
5
8
5
1
3
9
4
5
1
2
4
2
6
12
14

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1Dingledooper360.05582022/06/17 05:14:500B / 21B / 15B
2rotary-o360.05462022/06/18 22:23:380B / 17B / 17B

Ruby2 _

RankUserSizeTimeDateStatistics
1Dingledooper360.24152022/06/17 05:14:540B / 21B / 15B
2rotary-o360.19382022/06/18 22:23:240B / 17B / 17B

Perl _

RankUserSizeTimeDateStatistics
1tails280.04492022/06/15 09:21:270B / 13B / 15B
2Sisyphus290.04352022/06/15 04:18:360B / 9B / 18B

Python _

RankUserSizeTimeDateStatistics
1lynn360.09622022/06/15 01:50:450B / 23B / 12B
2orthoplex360.09542022/06/15 04:37:230B / 24B / 12B
3xnor360.09452022/06/15 06:12:090B / 23B / 12B
4Dingledooper360.09512022/06/15 16:14:250B / 24B / 11B
5Erik the Outgolfer360.11752022/06/16 01:07:320B / 23B / 12B
6huge dummy800.09072022/06/21 12:56:391B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1AlephSquirrel610.26072022/06/28 00:08:510B / ?B / ?B

JavaScript _

RankUserSizeTimeDateStatistics
1Dingledooper470.07802022/06/15 16:23:360B / 26B / 21B
2lynn490.07112022/06/15 02:05:570B / 27B / 22B
3Irratix510.06802022/06/15 04:44:320B / 27B / 24B
4KrausRaus550.06882022/06/14 21:35:440B / 29B / 26B

Perl6 _

RankUserSizeTimeDateStatistics
1Fleur481.72422022/06/16 11:31:030B / 23B / 23B

C _

RankUserSizeTimeDateStatistics
1Dingledooper660.04052022/06/17 05:08:140B / 32B / 34B
2tails660.04112022/06/17 14:49:050B / 32B / 34B
3rotary-o660.04222022/06/18 23:25:040B / 32B / 34B
4chocobi690.04112022/06/15 11:12:070B / 33B / 36B
5Fleur690.04082022/06/16 17:07:330B / 33B / 36B

Java _

RankUserSizeTimeDateStatistics
1rotary-o1390.17252022/06/18 22:35:060B / 85B / 50B

AWK _

RankUserSizeTimeDateStatistics
1Fleur280.04112022/06/15 09:52:550B / 11B / 17B
2McBusLuck360.04622022/06/27 01:36:110B / 15B / 21B

sed _

RankUserSizeTimeDateStatistics
1tails1370.07402022/06/28 13:21:020B / 56B / 68B

Bash _

RankUserSizeTimeDateStatistics
1Fleur290.01722022/06/15 08:58:570B / 12B / 15B
2Fleur ()290.03282022/06/15 09:54:300B / 13B / 15B
3McBusLuck320.03152022/06/27 01:44:210B / 15B / 15B
4Fleur (McBusLuck)280.04822022/07/06 12:37:460B / 13B / 14B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails360.09682022/06/27 09:32:060B / 17B / 15B
2McBusLuck420.09602022/06/27 02:01:390B / 18B / 18B

make _

RankUserSizeTimeDateStatistics
1tails1100.06252022/06/28 14:46:250B / 56B / 45B

xgawk _

RankUserSizeTimeDateStatistics
1Fleur280.05362022/06/28 18:42:340B / 11B / 17B

m4 _

RankUserSizeTimeDateStatistics
1tails750.04512022/06/28 14:03:060B / 30B / 45B

GolfScript _

RankUserSizeTimeDateStatistics
1tails170.11922022/06/27 10:41:450B / 4B / 13B
2lynn180.09792022/06/19 00:52:180B / 4B / 14B

gs2 _

RankUserSizeTimeDateStatistics
1tails80.26032022/06/20 15:48:381B / 6B / 1B

Nibbles _

RankUserSizeTimeDateStatistics
1tails70.05572022/06/20 15:58:245B / 2B / 0B

Lazy-K _

RankUserSizeTimeDateStatistics
1tails11400.39152022/06/28 11:35:060B / 614B / 526B
2tails (source)17160.39922022/06/28 11:19:300B / 836B / 643B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o736.66182022/06/18 17:26:390B / 48B / 22B

Language Ranking_

RankLangUserSizeScore
1Nibblestails710000
2gs2tails88750
3GolfScripttails174117
4Perltails282500
5AWKFleur282500
6xgawkFleur282500
7BashFleur (McBusLuck)282500
8Pythonlynn361944
9RubyDingledooper361944
10Ruby2Dingledooper361944
11Bash (builtins)tails361944
12JavaScriptDingledooper471489
13Perl6Fleur481458
14Python3AlephSquirrel611147
15CDingledooper661060
16Scalarotary-o73958
17m4tails75933
18maketails110636
19sedtails137510
20Javarotary-o139503
21Lazy-Ktails114061

return to the top page