- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
# My first attempt in J:
+/(>/)"1 <.@(10&^.)(2 & x:) (+%)/\(1x,1000$2)
# It gave the right answer, but took about an hour.
# Based on other people's comments I went back and figured out the relationship
# between one answer and the next, and came up with this,
# which runs in less than 1 second:
((((0{])+([:$[:":1{])>([:$[:":2{])),(1{]+2*2{]),1{]+2{])^:1000) 0 3x 2x
Copy-Paste 04.06.2012 20:11 # −8
bormand 04.06.2012 20:12 # +2
Copy-Paste 04.06.2012 20:13 # −11
Copy-Paste 04.06.2012 20:14 # −11
Copy-Paste 04.06.2012 20:14 # −11
Copy-Paste 04.06.2012 20:14 # −11
Copy-Paste 04.06.2012 20:14 # −11
vistefan 04.06.2012 21:27 # +4
TheHamstertamer 04.06.2012 23:14 # +6
vistefan 05.06.2012 09:58 # +2
roman-kashitsyn 04.06.2012 23:26 # +13
movaxbx 04.06.2012 23:48 # +1
guest 04.06.2012 23:57 # +5
TarasB 05.06.2012 11:37 # +3
vistefan 05.06.2012 12:01 # +3
TarasB 05.06.2012 16:15 # +5
http://www.dezcom.org/bbs/index.php?showtopic=60529
defecate-plusplus 05.06.2012 16:49 # +7
Lure Of Chaos 05.06.2012 17:11 # 0
roman-kashitsyn 05.06.2012 17:14 # +1