Angle difference

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

Find the shortest direction to turn to get from the first angle to the second. Positive for clockwise, negative for anticlockwise.

Options

exec is denied

rejudge feature is enabled

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

Sample input:_

0 60
60 0
315 45
45 315
270 90
90 270
60 60
0 0
0 180
359 1
1 359
358 359

Sample output:

60
-60
90
-90
180
180
0
0
180
2
-2
1

Sample input:_

259 113
36 77
76 314
22 122
179 240
134 168
35 73
305 339
244 286
174 72
71 320
307 74
284 66
16 354
272 95
6 140
5 55
234 200
253 225
343 150
123 168
159 270
121 73
284 152
211 113
58 14
137 15
293 302
340 34
217 81
0 10
92 156
5 298
70 246
299 326
20 28
27 253
23 280
104 7
298 356
302 163
51 239
98 256
186 63
16 3
7 143
128 272
333 104
316 131
270 324
147 109
120 36
223 320
214 75
268 346
124 0
205 102
235 16
4 352
311 312
306 49
44 350
302 81
221 181
57 246
266 55
88 348
15 49
269 156
91 162
202 43
0 0
118 50
189 80
269 211
349 0
31 111
219 22
106 252
307 44
122 145
278 272
78 65
352 30
188 340
41 325
250 336
145 296
331 282
322 253
84 237
198 163
172 141
261 308
20 18
312 101
26 267
354 185
225 161
237 265

Sample output:

-146
41
-122
100
61
34
38
34
42
-102
-111
127
142
-22
-177
134
50
-34
-28
167
45
111
-48
-132
-98
-44
-122
9
54
-136
10
64
-67
176
27
8
-134
-103
-97
58
-139
-172
158
-123
-13
136
144
131
175
54
-38
-84
97
-139
78
-124
-103
141
-12
1
103
-54
139
-40
-171
149
-100
34
-113
71
-159
0
-68
-109
-58
11
80
163
146
97
23
-6
-13
38
152
-76
86
151
-49
-69
153
-35
-31
47
-2
149
-119
-169
-64
28

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1teebee350.01762018/11/28 06:31:222B / 15B / 15B
2rotary-o350.02792018/11/28 23:10:122B / 15B / 15B
3llhuii350.02602018/12/03 23:43:262B / 15B / 15B
4mitchs350.01782018/12/04 02:15:492B / 15B / 15B
5olf370.02612018/11/24 19:44:072B / 15B / 17B
6Histocrat440.02742018/11/27 07:05:320B / 24B / 15B

Ruby2 _

RankUserSizeTimeDateStatistics
1teebee370.10652018/11/26 02:57:190B / 21B / 13B
2rotary-o370.15482018/11/27 01:22:540B / 21B / 13B
3llhuii370.10282018/12/03 23:44:070B / 21B / 13B
4mitchs370.10552018/12/04 02:16:040B / 21B / 13B
5olf380.10172018/11/24 19:37:020B / 21B / 14B
6letranger550.10522018/11/23 00:44:050B / 30B / 21B

Perl _

RankUserSizeTimeDateStatistics
1tails350.04972018/11/22 18:52:510B / 16B / 18B
2teebee350.02172018/11/25 22:13:210B / 16B / 18B
3mitchs350.02162018/12/04 02:30:150B / 16B / 18B
4llhuii350.02322018/12/04 10:54:400B / 16B / 18B
5%20360.02722018/11/24 07:57:390B / 17B / 18B

Python _

RankUserSizeTimeDateStatistics
1xnor590.04902018/11/23 04:38:520B / 39B / 18B
2llhuii590.04842018/12/02 23:24:430B / 39B / 18B
3mitchs590.04842018/12/04 02:39:050B / 39B / 18B
4algmyr600.11552018/11/29 07:54:060B / 39B / 18B
5lynn630.04812018/12/02 22:45:260B / 43B / 19B
6articulated aardvark1020.04922018/11/24 05:42:380B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1algmyr570.08402018/11/29 07:34:050B / 36B / 19B
2mitchs570.17822018/12/04 02:40:160B / 36B / 19B
3llhuii570.10152018/12/04 19:44:290B / 36B / 19B
4mypetlion590.08362018/11/29 04:26:150B / 36B / 21B

PHP _

RankUserSizeTimeDateStatistics
1teebee610.04002018/11/26 01:21:545B / 31B / 25B

Scheme _

RankUserSizeTimeDateStatistics
1teebee540.05732018/11/28 08:21:110B / 35B / 18B

Common LISP _

RankUserSizeTimeDateStatistics
1teebee540.04192018/11/28 07:31:140B / 32B / 19B

Arc _

RankUserSizeTimeDateStatistics
1teebee431.39282018/11/28 07:33:120B / 28B / 14B

Clojure _

RankUserSizeTimeDateStatistics
1teebee471.21232018/11/28 07:35:580B / 29B / 16B

Io _

RankUserSizeTimeDateStatistics
1teebee900.11822018/11/26 01:50:540B / 70B / 16B

JavaScript _

RankUserSizeTimeDateStatistics
1teebee580.02842018/11/26 01:02:460B / 34B / 23B
2llhuii580.03122018/12/04 11:03:410B / 33B / 24B
3ZED.CWT790.02962018/11/23 11:00:310B / 42B / 35B

Lua _

RankUserSizeTimeDateStatistics
1teebee560.02412018/11/26 01:53:220B / 36B / 18B

Tcl _

RankUserSizeTimeDateStatistics
1teebee590.05462018/11/26 01:54:200B / 37B / 15B

Xtal _

RankUserSizeTimeDateStatistics
1teebee770.03192018/11/26 02:32:550B / 42B / 32B

Prolog _

RankUserSizeTimeDateStatistics
1teebee540.05602018/11/26 01:56:110B / 31B / 21B

K _

RankUserSizeTimeDateStatistics
1teebee310.00712018/11/26 01:07:050B / 13B / 18B

Jelly _

RankUserSizeTimeDateStatistics
1Erik the Outgolfer130.52732021/05/19 16:25:485B / 4B / 4B

C _

RankUserSizeTimeDateStatistics
1llhuii700.02102018/12/03 00:32:220B / 35B / 35B
2tails700.02272018/12/03 13:51:420B / 35B / 35B
3rotary-o710.02242018/11/23 03:22:090B / 36B / 35B
4teebee710.02102018/11/26 01:05:510B / 37B / 34B
5chocobi850.02232018/11/23 21:42:160B / 43B / 42B

Java _

RankUserSizeTimeDateStatistics
1teebee1310.16962018/11/26 01:48:330B / 89B / 37B

Pascal _

RankUserSizeTimeDateStatistics
1teebee780.02422018/11/26 02:24:250B / 57B / 16B

Fortran _

RankUserSizeTimeDateStatistics
1teebee520.02812018/11/26 01:46:160B / 34B / 17B

C# _

RankUserSizeTimeDateStatistics
1teebee1470.08802018/11/26 05:19:190B / 99B / 43B

AWK _

RankUserSizeTimeDateStatistics
1teebee230.02092018/11/26 01:36:240B / 12B / 11B
2tails230.02162018/11/27 14:17:440B / 13B / 10B
3llhuii230.02082018/12/02 22:28:480B / 13B / 10B
4mitchs230.02102018/12/03 11:41:340B / 12B / 11B

jq _

RankUserSizeTimeDateStatistics
1teebee530.02232018/11/26 01:39:130B / 22B / 29B

Bash _

RankUserSizeTimeDateStatistics
1tails220.00982018/12/03 15:42:120B / 14B / 7B
2llhuii220.00952018/12/03 20:41:070B / 14B / 7B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1llhuii380.12092018/12/03 09:39:490B / 17B / 17B
2tails380.12212018/12/03 15:28:250B / 17B / 17B
3teebee390.04042018/12/06 04:41:130B / 21B / 14B

Zsh _

RankUserSizeTimeDateStatistics
1llhuii220.03462018/12/03 20:41:540B / 14B / 7B

Fish _

RankUserSizeTimeDateStatistics
1llhuii220.04672018/12/03 20:41:490B / 14B / 7B

dc _

RankUserSizeTimeDateStatistics
1tails260.01692018/12/03 15:40:530B / 15B / 11B
2llhuii260.01502018/12/03 23:08:180B / 15B / 11B

xgawk _

RankUserSizeTimeDateStatistics
1teebee230.03092018/11/26 01:37:070B / 12B / 11B
2llhuii230.03132018/12/02 22:29:030B / 13B / 10B
3mitchs230.02232018/12/04 02:43:040B / 12B / 11B

m4 _

RankUserSizeTimeDateStatistics
1tails690.02152018/11/27 14:59:560B / 39B / 29B

R _

RankUserSizeTimeDateStatistics
1ludo570.21242018/12/06 16:27:480B / 37B / 19B
2teebee580.22352018/11/26 01:13:030B / 36B / 22B
3olf610.25842018/11/24 00:43:490B / 39B / 20B

GolfScript _

RankUserSizeTimeDateStatistics
1tails190.04322018/11/22 19:16:540B / 8B / 11B
2mitchs190.03922018/12/04 03:39:010B / 8B / 11B

gs2 _

RankUserSizeTimeDateStatistics
1tails130.13702018/11/22 19:12:255B / 7B / 1B
2mitchs130.12212018/12/04 03:45:314B / 7B / 2B

Nibbles _

RankUserSizeTimeDateStatistics
1tails70.03242022/02/07 14:25:514B / 3B / 0B

Groovy _

RankUserSizeTimeDateStatistics
1teebee721.46432018/11/26 05:13:250B / 49B / 22B

Scala _

RankUserSizeTimeDateStatistics
1teebee644.76372018/11/26 02:08:370B / 41B / 22B
2rotary-o647.64062018/11/27 01:06:540B / 41B / 21B
3llhuii646.79222018/12/04 19:21:050B / 41B / 22B

Logo _

RankUserSizeTimeDateStatistics
1teebee510.02292018/11/26 01:24:480B / 36B / 12B

Language Ranking_

RankLangUserSizeScore
1Nibblestails710000
2gs2tails135384
3JellyErik the Outgolfer135384
4GolfScripttails193684
5Bashtails223181
6Fishllhuii223181
7Zshllhuii223181
8AWKteebee233043
9xgawkteebee233043
10dctails262692
11Kteebee312258
12Perltails352000
13Rubyteebee352000
14Ruby2teebee371891
15Bash (builtins)llhuii381842
16Arcteebee431627
17Clojureteebee471489
18Logoteebee511372
19Fortranteebee521346
20jqteebee531320
21Prologteebee541296
22Common LISPteebee541296
23Schemeteebee541296
24Luateebee561250
25Python3algmyr571228
26Rludo571228
27JavaScriptteebee581206
28Pythonxnor591186
29Tclteebee591186
30PHPteebee611147
31Scalateebee641093
32m4tails691014
33Cllhuii701000
34Groovyteebee72972
35Xtalteebee77909
36Pascalteebee78897
37Ioteebee90777
38Javateebee131534
39C#teebee147476

return to the top page