text:
RadioASCII Elements: Output the elements of the periodic table while slowly losing characters
Here is a list of the 118 (current) elements of the periodic table (in a collapsed Stack Snippet for your convenience):

Hydrogen
Helium
Lithium
Beryllium
Boron
Carbon
Nitrogen
Oxygen
Fluorine
Neon
Sodium
Magnesium
Aluminium
Silicon
Phosphorus
Sulfur
Chlorine
Argon
Potassium
Calcium
Scandium
Titanium
Vanadium
Chromium
Manganese
Iron
Cobalt
Nickel
Copper
Zinc
Gallium
Germanium
Arsenic
Selenium
Bromine
Krypton
Rubidium
Strontium
Yttrium
Zirconium
Niobium
Molybdenum
Technetium
Ruthenium
Rhodium
Palladium
Silver
Cadmium
Indium
Tin
Antimony
Tellurium
Iodine
Xenon
Caesium
Barium
Lanthanum
Cerium
Praseodymium
Neodymium
Promethium
Samarium
Europium
Gadolinium
Terbium
Dysprosium
Holmium
Erbium
Thulium
Ytterbium
Lutetium
Hafnium
Tantalum
Tungsten
Rhenium
Osmium
Iridium
Platinum
Gold
Mercury
Thallium
Lead
Bismuth
Polonium
Astatine
Radon
Francium
Radium
Actinium
Thorium
Protactinium
Uranium
Neptunium
Plutonium
Americium
Curium
Berkelium
Californium
Einsteinium
Fermium
Mendelevium
Nobelium
Lawrencium
Rutherfordium
Dubnium
Seaborgium
Bohrium
Hassium
Meitnerium
Darmstadtium
Roentgenium
Copernicium
Ununtrium
Flerovium
Ununpentium
Livermorium
Ununseptium
Ununoctium

Note: This list was found by running the following JavaScript code on this Wikipedia page: [].slice.call($('.wikitable:first tr td:nth-child(3)').map(function(){return this.innerText})).slice(1,-1).join('\n')
Your challenge is to output as many of them as possible, in as many languages as possible. This goal is even further complicated by the fact that the radioactive elements are slowly eating away at your remaining usable characters as you go!
Rules

Your answer will consist of 1 to 95 code snippets.
Each code snippet must be in a different programming language. For the purpose of this challenge, I'm using a very loose definition of "language": Anything that's not backwards-compatible is a different language. For example, if all Lang A code works in Lang B but Lang B adds more, then they're considered the same language. But Python 2 and Python 3 are considered different, because print 'foo' is valid in Python 2 but not in Python 3.
The first code snippet may use some or all of the 95 printable ASCII characters. In the second snippet, one ASCII character of your choice will be forbidden. In the third snippet, that character plus one more of your choice must be forbidden. And so on. Tabs and newlines are never forbidden.
The forbidden character must have been used in the previous snippet, not in a comment, string literal, etc.; it must actually get interpreted by the compiler/interpreter. For example, if my first snippet is print 'Hydrogen', I can't make & forbidden because I didn't use it. My choices are any of the characters p, r, i, n, t, , or ' (I can't use H, y, d, ... because those are in a string literal). The character you choose is from then on forbidden to appear at all in any subsequent snippets.
Each code snippet must output a unique element of the periodic table (found in the list above). "Output" can be done by any method you wish: STDOUT, an alert box (ex. in JS), REPL "output" (keep in mind that if it includes quotes, it's invalid), writing to a file, etc.
You must either take no input, or an empty string as input (for languages like sed).
You may not use built-in functions that return the element name (ex. ElementData in Mathematica).

Formatting
Please format your answer with the following format:
### 1. Language A - none forbidden

    code

Optional commentary on this snippet goes here.

### 2. Language B - `a` forbidden

    code

More optional commentary

### 3. Language C - `ab` forbidden

    code

More optional commentary

etc.
If backticks (`) are forbidden, simply use two backticks around the list instead. For example, ``ab`cd`` will result in ab`cd. (If the backtick is the first or last character, you must also pad the outer backticks with spaces; ex. `` abc` `` -> abc`.)
Scoring
The answer with the most programming languages will win. In the event of a tie, the answer with the smallest cumulative character count of all of the programs will win.

This question was inspired by this.

Just so I get this right, this is basically the same as the 95 movie quotes challenge except everyone is playing it solitaire?

@MartinBüttner Yes, that's essentially what it is. (Also, the criterion for "separate language" is less strict, the outputs are shorter, and the forbidden character has some restrictions.)

Forbidden characters can't be chosen from string literals, and they also can't be used in future strings?

I'm just sad you didn't use the term "RadioASCII Elements".

@Scimonster Yes, that is correct.

@Calvin'sHobbies [status-completed] ;)

@DLosc Not all C code is valid C++.. for example, naming a variable class.

Should I take "code snippet" to mean "not necessarily a complete program," e.g. cout<<"Hydrogen"; in C++? Do we need to include includes in the code? Does a program need to print a newline after the name of the element?

@DLosc No, the snippets must all be full, runnable, complete programs. The newline is optional.

Please note that this list of elements is now out-of-date. All elements are now officially named.

95 languages (all characters used!)
(TODO: a couple more answers that I have planned out but not implemented)
1. COBOL - forbids A
PROGRAM-ID.g.PRODECURE DIVISION.DISPLAY"Ununtrium".

Prints Ununtrium.
2. REBOL - forbids B
REBOL[]prin"Tellurium"

Prints Tellurium.
3. bc - forbids ^
a=0^0
"Strontium"

Prints Strontium.
4. D - forbids D
void main(char[][]D){printf="Ruthenium";}

Prints Ruthenium.
5. Java - forbids E
enum E{E;{System.out.print("\x41luminium");}}

Prints Aluminium.
6. Scala - forbids F
val F=print("Plutonium")

Prints Plutonium.
7. Rust - forbids G
fn main(){let G:u8;print("\x41mericium")}

Prints Americium.
8. Nim - forbids &
discard 0&0
echo "Neptunium"

Prints Neptunium.
9. C# - forbids C
class V{static void Main(){System.Console.Write("Neodymium");}}

Prints Neodymium.
10. Burlesque - forbids %
,1 1.%vv"Manganese"Q

Prints Manganese.
11. Nemerle - forbids I
Nemerle.IO.print("Magnesium")

Prints Magnesium.
12. Ada - forbids J
procedure gnat.io.J is begin put("Palladium");end;

Prints Palladium.
13. Go - forbids |
package main
func main(){if 1|1>0{print("Germanium")}}

Prints Germanium.
14. K - forbids ```
`0:"Ytterbium"

Prints Ytterbium.
15. Erlang - forbids /
-module(test).
-export([m/0]).
m()->io:put_chars("\x42eryllium").

Prints Beryllium.
16. Prolog - forbids :
m:-write('\102erkelium').

Prints Berkelium.
17. Smalltalk - forbids K
K:=0.'Lanthanum'display

Prints Lanthanum.
18. PARI/GP - forbids L
print(Potassium)

Prints Potassium.
19. REXX - forbids M
M=0
say "Tungsten"

Prints Tungsten.
20. LilyPond - forbids N
#(let((N 0))(print"\x46levorium"))

Prints Flevorium.
21. Arc - forbids Q
(let Q 1(pr "\x41ntimony"))

Prints Antimony.
22. Common LISP - forbids R
(let((R 0))(princ"Tantalum"))

Prints Tantalum.
23. Clojure - forbids U
(def U)(pr'Selenium)

Prints Selenium.
24. Logo - forbids Z
to Z
end
pr[Scandium]bye

Prints Scandium.
25. Groovy - forbids W
print"Samarium";W=0

Prints Samarium.
26. Asymptote - forbids X
write('\x52ubidium');int X=0;

Prints Rubidium.
27. Octave - forbids Y
Y=0;disp Yttrium

Prints Yttrium.
28. gnuplot - forbids V
V=0;prin"Vanadium

Prints Vanadium.
29. Kite - forbids z
z=0;"\x4eobelium"|print;

Prints Nobelium.
30. Squirrel - forbids _
print("\x4eitrogen");local _=0;

Prints Nitrogen.
31. Curry - forbids v
v=v;main=putStr"\x4cutetium"

Prints Lutetium.
32. Fortran - forbids q
q=0;print'("Thallium")';end

Prints Thallium.
33. Pascal - forbids l
begin;var l:integer;write(#70#114#97#110#99#105#117#109)end.

Prints Francium.
34. PHP - forbids k
<?=$k="\70\108\117\111\114\105\110\101";

Prints Fluorine.
35. Haskell - forbids S
main=putStr"Sodium"

Prints Sodium.
36. C++ - forbids ~
#include<cstdio>
main(){~puts("\x41ctinium");}

Prints Actinium.
37. ObjC - forbids j
main(j){puts("Hydrogen");}

Prints Hydrogen.
38. Lua - forbids g
print("\65statine")

Prints Astatine.
39. JavaScript - forbids b
alert("\x43h\x6corine")

Alerts Chlorine.
40. Bash - forbids h
echo Osmium

Prints Osmium.
41. Cyan - forbids o
say"Hassium"
o=0

Prints Hassium.
42. J - forbids d
wd'Titanium'

Prints Titanium.
43. Scheme - forbids x
(let((x 0))(print"Vana\x64ium"))

Prints Vanadium.
44. C - forbids {
main(){puts("\x55ranium");}

Prints Uranium.
45. FORTH - forbids m
84 emit
104 emit
111 emit
114 emit
105 emit
117 emit
109 emit

Prints Thorium.
46. BASIC - forbids T
T$="Tin"
?T$

Prints Tin.
47. Perl 6 - forbids y
say "\o124\o145\o162\o142\o151\o165\o155"

Prints Terbium.
48. Asdf - forbids a
asaasaasssasaasssassaasaasssaasaasssaasaasssaasaasssaasaasssasaasssassaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassaasaasssaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassasaasssassaasaasssasaasssassasaasssassaasaasssaasaasssasaasssassaasaasssasaasssassaasaasssasaasssassasaasssassaasaasssasaasssassasaasssassasaasssassaasaasssaasaasssasaasssassasaasssassaasaasssasaasssassaasaasssaasaasssasaasssassaasaasssasaasssassasaasssassaasaasssaasaasssaasaasssasaasssassasaasssass

Prints Arsenic. Generating script.
49. Tcl - forbids s
puts "\123\151\154\151\143\157\156"

Prints Silicon.
50. Perl - forbids ;
print"\122\150\157\144\151\165\155";

Prints Rhodium.
51. Python - forbids r
print"\103\150\162\157\155\151\165\155"

Prints Chromium.
52. WARP - forbids =
=nn0(82(104(110(105(117(109

Prints Rhenium.
53. ETA - forbids n
nnOtOe nHHOne enenteht O
nnHHHe nHHtOe enenteht O
nntOHe nHHtne enenteht O
nnHnHe nHHtne enenteht O
nntnte nHHtne enenteht O
nHOHne nHHHte enenteht O

Prints Bromine.
54. Axo - forbids \
99*3+(94+8*('u'(93+9*(35*7*('fu'(7+(\

Prints Thulium.
55. Ruby - forbids t
putc 69
putc 117
putc 114
putc 111
putc 112
putc 105
putc 117
putc 109

Prints Europium.
56. DBFV! - forbids u
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u3 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u8 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 u>
u<9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u9 *u6 *u4 u>

Prints Niobium. Each space is actually a newline.
57. Mouse - forbids '
77 !' 101 !' 114 !' 99 !' 117 !' 114 !' 121 !'

Prints Mercury.
58. Word - forbids f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.

Prints Cadmium.
59. Ftack - forbids $
H 109 117 105 104 116 105 $ 1 76

Prints Lithium.
60. WASD - forbids e
We introduce the concept of the trivial Brainfuck solution (TBS): we can print any character in 257 Brainfuck commands by incrementing the accumulator c times, outputting, then incrementing it (256-c) more times to reset it. Repeating this for each character in the string yields the solution. Whenever we have two subprograms i and o that function exactly like Brainfuck's + and ., we call the translated TBS the (i, o)-TBS.
Instead of wrapping around we might be able to set the accumulator to zero after printing using some subprogram o'. This is the (i, o')-zeroing TBS.
Alternatively, we might have no wrapping but a subprogram d that decrements the accumulator. This is a the (i, o, d)-TBS.
For WASD a (w, e)-TBS prints Silver.
61. URSL - forbids w
A (i1, w1, c1)-TBS prints Krypton.
62. Emmental - forbids #
#73#114#105#100#105#117#109

Prints Iridium.
63. Owl - forbids ?
0[]?83)117)108)102)117)114)

Prints Sulfur.
64. RUBE - forbids )
    +   +   +       +
 8478 666 667 6965767 6 )
 cccccccccccccccccccccccc

 ........................
O
c
.

Prints Holmium.
65. Headsecks - forbids (
A ((, ")-TBS prints Bohrium.
66. FALSE - forbids [
[]!71,97,108,105,117,109,

Prints Gallium.
67. Betterave - forbids -
,-,++66,-,+8,+5,+*55,*8958

Prints Hafnium.
68. Kipple - forbids >
70>o 101>o 114>o 109>o 105>o 117>o 109>o

Prints Fermium.
69. GolfScript - forbids ]
68]117]98]110]105]117]109]""^

Prints Dubnium.
70. FlogScript - forbids "
67"P.97"P.108"P.99"P.105"P.117"P.109"P.

Prints Calcium.
71. OOo CODE - forbids p
A (PpP, PPp)-TBS prints Bismuth.
72. dc - forbids P
67P97P100P109P105P117P109P

Prints Cadmium.
73. Capuirequiem - forbids O
82O97O100O105O117O109O

Prints Radium.
74. BitChanger - forbids }
TODO

Prints Cobalt.
75. Vrejvax - forbids <
TODO

Prints Cerium.
76. Fueue - forbids H
80 111 108 111 110 105 117 109 H

Prints Polonium.
77. Pi - forbids 6
Run bf2pi from the wiki article on a trivial Brainfuck solution to print Xenon.
78. CJam - forbids 5
A (1+, c 0)-zeroing TBS (with 0 prepended) prints Nickel.
79. Wordfuck - forbids 9
A (9999, 99)-TBS prints Carbon.
80. Lenguage - forbids 7
≈ 3^(257*4*3) sevens

See 91-94 (use only 7.) Prints Radon.
81. Binaryfuck (hexadecimal) - forbids 4
TODO

Prints Barium.
82. CaneCode - forbids 8
A (1, 8)-TBS prints Iodine.
83. Numberwang - forbids 3
A (2, 3)-TBS prints Indium, but 2 decrements instead of incrementing, so subtract each character code from 256 first.
84. ferNANDo - forbids 2
1 1 1
2 1 2 2 2 2 2 1
2 1 1 1 2 2 1 2
2 1 1 2 2 1 1 1
2 1 1 2 1 1 1 1
2 1 1 2 1 1 1 2

Prints Argon.
85. Unefunge-98 - forbids @
Prepending 0 to a (1+, ,0)-zeroing TBS, and appending @, prints Helium.
86. Whirl - forbids 1
Prepending One Load Zero to an (Add, AscIO Zero)-zeroing TBS prints Boron.
87. ReverseFuck - forbids ,
A (-, ,)-TBS prints Erbium.
88. Brainfuck - forbids +
A (+, .)-TBS prints Curium.
89. Deadfish~ - forbids c
An (i, c)-TBS prints Copper.
90. Iota - forbids i
We compute a Church-numeral base-256-decoding to Zinc to make up for Iota's lack of IO. Define
succ = ***i*i*i*ii***i*i*i*ii**i*i*ii*i*i*i*ii*i*i*ii

Then the solution is 1516858978 repetitions of succ followed by *ii, for a total length of 69775512991 bytes.
Unary-like programs
The following four solutions (and 70) are similar: they all consist of approximately 3^(257*4*3) repetitions of the character they forbid (except Ellipsis is thrice as long). The exact value is decided by converting the TBS to octal as described on the wiki.
91. Ellipsis - forbids .
≈ 3^(257*4*3+1) periods

Prints Neon.
92. Ecstatic - forbids !
≈ 3^(257*4*3) exclamation marks

Prints Lead.
93. MGIFOS - forbids *
≈ 3^(257*4*3) asterisks

Prints Iron.
94. Unary - forbids 0
≈ 3^(257*4*3) zeros

Prints Gold.
95. Whitespace - forbids space
The Whitespace program generated by this Python script:
import sys
for c in 'Oxygen':
    print '   ' + ''.join(' \t'[int(b)] for b in bin(ord(c))[2:])
    sys.stdout.write('\t\n  ')
print '\n\n'

prints Oxygen.

So... you use the characters you forbid in almost every program?

When I write "forbids x", I really mean "uses x and forbids it for the next solutions". The string became unmanageable otherwise.

Oh, OK. Although having them all together would make it easier to look for any mistakes :)

51 Languages
I might add to this later, but here are 51 languages.
1. Java - none forbidden
public class p{public static void main(String[]J){System.out.println("Tellurium");}}

2. C++ - J forbidden
#include<cstdio>
main(){int Q=std::puts("Palladium");}

3. C - JQ forbidden
main(W){puts("Neodymium");}

4. D - JQW forbidden
import std.stdio;void main(string[]z){write("Zirconium");}

5. Nimrod - JQWz forbidden
var q="Ruthenium"
echo q

6. Fortran-95 - JQWzq forbidden
program Y
print *,"Potassium"
end program Y

7. Batch - JQWzqY forbidden
@set @c=Aluminium&echo %@c%

8. Befunge - JQWzqY% forbidden
"muinoloP">:#,_@

Output Polonium.
9. Vala - JQWzqY#% forbidden
int main(string[]@a){print("Manganese");return 0;}

10. Bash - JQWzqY#%@ forbidden
cd /usr/bin ~/cake;./echo Germanium

11. ECMAScript 6 - JQWzqY#%@~ forbidden
alert(`Strontium`)

12. Perl 5 - JQWzqY#%@~` forbidden
$_=Magnesium;say

13. Scala - JQWzqY#%@~`_ forbidden
object e{def main(args:Array[String]){print("\u0059tterbium")}}

14. Perl 6 - JQWzqY#%@~`_: forbidden
$j='Lanthanum';say

15. Python 2 - JQWzqY#%@~`_:j forbidden
print'Lutetium'

16. Python 3 - JQWzqY#%@~`_:jL forbidden
print('Krypton')

17. PHP - JQWzqY#%@~`_:jLK forbidden
$n='Berkelium';echo$n;

18. Pascal - JQWzqY#%@~`_:jLK$ forbidden
Program f(X);begin write('Ununtrium');end.

19. POGAACK - JQWzqY#%@~`_:jLK$X forbidden
poock!pogack?poock!pock!pock!pock!pock!pock!pock!pogack!pogaaack!pogaack!pogaack?pogack!poock!pogaaack?pogack?poock!pock!pock!pogack!pogaaack!pock!pock!pock!pock!pogaack!pogaack?pogack!pogaaack!pogaaack?poock!pock!pogack?poock!pogack!pogaaack!pock!pock!pogaack!pogaack?pogack!poock!pogaaack?pogaaack!pock!pock!pock!pock!pock!pock!pock!pock!pock!pock!pock!pock!pock!pogaaack?poock!pock!pock!pogaaack?poock!pock!pock!pock!pock!pock!pock!pock!pogaaack?poock!pock!pogaaack?pogaaack!pock!pock!pock!pock!pock!pock!pock!pogaaack?

Prints Hydrogen.
20. COW - JQWzqY#%@~`_:jLK$Xg forbidden
MoOMoOMoOMoOMOOmoOMoOMoOMoOMoOMoOmOoMOomoomoOMOOmoOMoOMoOMoOMoOmOoMOomoomoOMooMoOMOOMOoMOoMOomoOMoOMoOMoOMoOmOomoomoOMooMoOMoOMoOMoOMoOMoOMoOMoOMoOMooMOoMooMOoMOoMOoMOoMOoMooMOoMooMOoMOoMOoMOoMOoMooMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMoOMooMOoMOoMOoMOoMOoMOoMOoMOoMoo

Prints Plutonium.
21. Blub - JQWzqY#%@~`_:jLK$XgM forbidden
Blub!Blub!Blub!Blub?Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub?Blub.Blub.Blub?Blub.Blub?Blub!Blub.Blub?Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub!Blub!Blub!Blub!Blub!Blub?Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub?Blub.Blub.Blub?Blub.Blub?Blub!Blub.Blub?Blub!Blub.Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub!Blub.Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub!Blub.Blub!Blub?Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.Blub?Blub.Blub.Blub?Blub.Blub?Blub!Blub.Blub?Blub!Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub.Blub!Blub.Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub!Blub.

Prints Flerovium.
22. Ook!- JQWzqY#%@~`_:jLK$XgMB forbidden
Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook?Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook.Ook?Ook.Ook.Ook?Ook.Ook?Ook!Ook.Ook?Ook.Ook.Ook.Ook.Ook!Ook.Ook!Ook?Ook!Ook!Ook!Ook!Ook!Ook!Ook.Ook?Ook.Ook.Ook?Ook.Ook?Ook!Ook.Ook?Ook.Ook.Ook.Ook.Ook!Ook.Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook!Ook.Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook.Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook!Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook.Ook!Ook.Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook!Ook.

Prints Americium.
23. Ruby - JQWzqY#%@~`_:jLK$XgMB! forbidden
def e?()return "Neptunium"end;print e?

24. Lua - JQWzqY#%@~`_:jLK$XgMB!? forbidden
f=2*4 if f==8then print("Titanium")end

25. R - JQWzqY#%@~`_:jLK$XgMB!?* forbidden
U<-"Rubidium";print(U)

26. Scheme - JQWzqY#%@~`_:jLK$XgMB!?*U forbidden
(display "Francium")

27. TI Basic - JQWzqY#%@~`_:jLK$XgMB!?*U) forbidden
Disp ("Vanadium"

28. REXX - JQWzqY#%@~`_:jLK$XgMB!?*U)( forbidden
do Z=1 to 1
    say 'Europium'
end
return

29. BASIC (Yabasic) - JQWzqY#%@~`_:jLK$XgMB!?*U)(Z forbidden
PRINT "Chromium"

30. Pyth - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI forbidden
|0"Scandium

31. CJam - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI| forbidden
"Nobelium"1\\-

32. GolfScript - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\ forbidden
"Samarium"1/

33. Brainfuck - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/ forbidden
,>-[--->+<]>-----.+[--->++++<]>.-----------.--[--->+<]>-.-----------.+++++.+++++++.--------.

Takes an empty string as input.
34. Haskell - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/, forbidden
'Antimon'++['y']

35. Deadfish - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[ forbidden
iisiiiisiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioddddddoiiiodddddddddoiiiiiodddddddddo]

One of the few of these snippets to output a newline afterwards.
36. Rebmu - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[] forbidden
PR"Tungsten"

37. Tcl - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P forbidden
puts "Actinium"

38. There Once was a Fish Named Fred - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P" forbidden
a named a a a once was there Fred once a a fish named a a a a a once was was was there Fred once fish was was was was was was was fish a a a a a a a fish was was was was was was was was was fish a a a a a fish was was was was was was was was was was was was fish a a a a a a a a fish

Prints Selenium.
39. BrainFNORD - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"F forbidden
eris 23 eris eris eris fnord hail pineal 5 fnord eris eris eris eris eris eris eris kallisti 23 eris eris eris fnord hail hail hail hail pineal 5 fnord hail kallisti hail hail hail hail hail hail hail hail hail hail hail kallisti eris eris kallisti eris eris eris kallisti eris eris eris eris eris eris eris eris kallisti eris eris kallisti hail hail hail hail hail hail hail hail hail kallisti

Prints Nitrogen.
40. Text - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fl forbidden
Astatine

41. J - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln forbidden
'Caesium'

42. Pi - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln' forbidden
3.4743302180342223222232222423222332223225222222427402331802252232322322343223322224434433435

Prints Tantalum.
43. Marbelous - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'. forbidden
43686C7072696E65
      --        }0

Prints Chlorine. This relies on the use of spaces for empty cells. Marbelous Interpreter
44. DNA# - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.} forbidden
ATCGGCTAATCGATCGATCGATATATTAATGCGCCGATATATCGGCATGCTAATCGATCGATCGATCGATATATTAATTAATTAATTAATTAATGCGCCGATATATCGGCATATCGATCGATCGATCGATCGATCGATCGGCATATTAATTAATTAATTAATTAATTAATTAATTAATTAATTAATTAGCATGCATATCGATCGATCGGCATATTAATTAATTAATTAATTAATTAATTAATTAATTAATTAATTAATTAGCATATCGATCGATCGATCGATCGATCGATCGATCGGCAT

Prints Thallium.
45. oOo - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}G forbidden
OoOOoOOoOOoOoOoOoOOoOOoOOoOoooOooOooOooooOoOOoooOooOOoOooOooOoooOoOooOooOooOooOoooooOoOooOoOOoooOooOOoOooOooOooOOoOooOooOOoOooOooOooOooOOoOoOOoOOoOOoOOoOOOoOooOooOooOooOooOooOooOooOooOOo

Prints Bromine.
46. ABC - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GO forbidden
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAACAAAAAC

Prints Tin. Note that the interpreters on esolang are all unavailable. However, 4chan's implementation written in Scheme works (#59).
47. WASD - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GOC forbidden
w1sssdwwa2dwwwe1sssdwa2dweessesssssssssewwwwwwwwwwwwesssssssse

Prints Yttrium.
48. Super Stack! - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GOCw forbidden
99 105 110 101 115 114 65
if outputascii fi

Prints Arsenic.
49. Golunar - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GOCws forbidden
1334726751425099782624362025339077479253628945660119316869724137277474322140

Prints Lithium.
50. Unary - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GOCws1 forbidden
The source is 0 repeated
40732627912143966203790325934799402365062057246763194506454552300861148

times.
Prints Hassium.
51. Lenguage - JQWzqY#%@~`_:jLK$XgMB!?*U)(ZI|\/,[]P"Fln'.}GOCws10 forbidden
The source is > repeated
9305604867582777545366404070305393137665254080212227303922021923795365639900

times.
Prints Bohrium.

Most of the odd languages used can be found on the esolangs wiki.
Please note that all brainfuck (and brainfuck derivatives) snippets were written with 8-bit cells in mind.

Sorry but all those 2 was pretty strange for Pi language so I ran it on my interpreter (http://migl.io/projects/pi), actually it returns ª·ÄÊcnw.

@Mig 2 is repeated a lot since for any digit of pi greater than or equal to 3, it represents +. The Pi code used in my answer requires 8-bit cells (it begins by decrementing 0), and produces the correct output on the interpreter in the esolang page for Pi.

20 24 languages
Here's something to get the ball rolling.  I decided to do the elements in order because I don't know enough languages for the order to matter much.
1. C# - none forbidden
public class P{public static void Main(){System.Console.Write("Hydrogen");}}

2. PHP - W forbidden
echo$e="Helium";

3. QBasic - W$ forbidden
?"Lithium"

4. Windows Batch Script - W$? forbidden
dir>nul&echo Beryllium

5. Brainf*** - W$?& forbidden
++++++[>+++++++++++<-]>.----------[>++<-]-.+++.---.-.

Outputs Boron.
6. C++ - W$?&+ forbidden
#include<iostream>
main(){std::cout<<"Carbon";}

7. Befunge - W$?&+< forbidden
"n eg or ti N">,_@

Outputs Nitrogen.
8. Bash - W$?&+<@ forbidden
echo Oxygen 2>1

9. Sisi - W$?&+<@> forbidden
9 print "Fluorine"

10. C - W$?&+<@>9 forbidden
#include"stdio.h"
main(){printf("Neon%c",10);}

11. Common Lisp - W$?&+<@>9, forbidden
(format t "~Codium" #\S)

12. Zephyr - W$?&+<@>9,# forbidden
if 1\=0:print"Magnesium";end if

13. Prolog - W$?&+<@>9,#\ forbidden
:-write('Aluminium').

(Test here.)
14. Java - W$?&+<@>9,#\: forbidden
class A{public static void main(String[]a){System.out.print("Silicon");}}

15. Golfscript - W$?&+<@>9,#\:. forbidden
];"Phosphorus"

16. Pyth - W$?&+<@>9,#\:.] forbidden
|0"Sulfur

17. ActionScript - W$?&+<@>9,#\:.]| forbidden
trace("Chlorine");

18. PowerShell - W$?&+<@>9,#\:.]|; forbidden
write-host"Argon"

Fortunately, PowerShell commands can be written in lowercase, avoiding the forbidden W.
19. JavaScript - W$?&+<@>9,#\:.]|;- forbidden
alert("Potassium")

20. Python 3 - W$?&+<@>9,#\:.]|;-" forbidden
print('Calcium')

21. Python 2 - W$?&+<@>9,#\:.]|;-"( forbidden
print'Scandium'

22. Perl - W$?&+<@>9,#\:.]|;-"(' forbidden
say q{Titanium}

23. Ruby - W$?&+<@>9,#\:.]|;-"('{ forbidden
puts %q!Vanadium!

24. CJam - W$?&+<@>9,#\:.]|;-"('{! forbidden
67c104c114c111c108)c105c117c108)c

Outputs Chromium. ) increments were used to avoid the forbidden 9 in 109 (m).

sed seems to complain: sed: -e expression #1, char 0: no previous regular expression - maybe try s/./Beryllium/ or s/^/Beryllium/?

Don't you need the function declaration for C and C++?

@professorfish Good catch--I didn't get a chance to test all of these. Now that I have, sed (v 4.2.1 on Ubuntu 12.04) doesn't give an error or indeed do anything on an empty input as specified by the OP. (I.e. echo -n | sed -e 's/^/Beryllium/'.) I may replace it with something else.

@BetaDecay Fixed.

23 Languages
I set out to beat the 20 language answer... and now I can't be bothered to shoot for 52. ;)
1. Mathematica - none forbidden
J;"Krypton"

2. Ruby - J forbidden
K=1;puts 'Vanadium'

3. Python 2 - JK forbidden
Q=1;print 'Xenon'

4. Python 3 - JKQ forbidden
X=1;print('Osmium')

5. PHP - JKQX forbidden
$V=1;echo 'Oxygen';

6. Julia - JKQXV forbidden
O=1;println('Ytterbium')

7. JavaScript - JKQXVO forbidden
Y=1;alert('Yttrium')

8. CoffeeScript - JKQXVOY forbidden
q=1;alert 'Zinc'

9. C - JKQXVOYq forbidden
main(Z){printf("Zirconium");}

10. C++ - JKQXVOYqZ forbidden
#include <cstdio>
int main(){int x;printf("Lawrencium");}

11. Matlab - JKQXVOYqZx forbidden
w=1;'Nickel'

12. Perl - JKQXVOYqZxw forbidden
$k=1;print "Berkelium";

13. Perl 6 - JKQXVOYqZxwk forbidden
$f=1;say'Darmstadtium';

14. Java - JKQXVOYqZxwkf forbidden
public class p{public static void main(String[]v){System.out.println("Dubnium");}}

15. Marbelous - JKQXVOYqZxwkfv forbidden
44797370726F7369756D

Prints Dysprosium.
16. Lua - JKQXVOYqZxwkfvD forbidden
G=1;print("Erbium")

17. Octave - JKQXVOYqZxwkfvDG forbidden
F=1;disp('Einsteinium');

18. Rust - JKQXVOYqZxwkfvDGF forbidden
fn main(){let E=1;println!("Europium");}

19. Fortran - JKQXVOYqZxwkfvDGFE forbidden
print *,"Indium"

20. CJam - JKQXVOYqZxwkfvDGFEp forbidden
H;"Iodine"

21. Golfscript - JKQXVOYqZxwkfvDGFEpH forbidden
U"Iridium"

22. Pyth - JKQXVOYqZxwkfvDGFEpHU forbidden
I1"Iron

I think this should be
if 1:
    print "Iron"

23. Brainfuck - JKQXVOYqZxwkfvDGFEpHUI forbidden
++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++<<<<<<<<<<<<<<<<-]>>>>>>>>++.--<<<<<<<<>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<>>>>>>>>>>>>>>++.--<<<<<<<<<<<<<<>>>>>>>>>>>>>>>+.-<<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>+.-<<<<<<<<<<<<<>>>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<<.

Prints Beryllium.

Your Pyth answer does what you think it does :)

How did you forbid G in language 17? There isn't a G in the Lua answer...

@BetaDecay thanks, fixed!

20 21 26 languages
Okay, let's see if I can do something out of this, not even trying to aim for top spot... if I can get 20 languages without any mistakes I'll be more than happy.
1. JAVA - none forbidden
class J{public static void main(String[]a){System.out.print("Hydrogen");}}

Prints Hydrogen.
2. Pascal - J forbidden
Program H; begin write('Helium'); end.

Prints Helium.
3. C - JP forbidden
#include <stdio.h> main(){printf("Lithium");}

Prints Lithium.
4. PHP - JPf forbidden
<?php echo "Beryllium";?>

Prints Beryllium.
5. C# - JPf? forbidden
using System;class O{static void Main(){Console.Write("Boron");}}

Prints Boron.
6. PROLOG - JPf?W forbidden
:-initialization(main). main:-write('Carbon').

Prints Carbon - tested here.
7. JavaScript - JPf?W' forbidden
<html>
    <script language="javascript" type="text/javascript">
        alert("Nitrogen");
    </script>
</html>

Prints Nitrogen.
8. LOLCODE - JPf?W'= forbidden
HAI
    VISIBLE "Oxygen"
KTHXBYE

Prints Oxygen.
9. Befunge '93 - JPf?W'=K forbidden
"eniroulF">:#,_@

Prints Fluorine - tested here.
10. Visual Basic - JPf?W'=K@ forbidden
Module V
    Sub Main()
        Console.WriteLine("Neon")
    End Sub
End Module

Prints Neon.
11. HTML5 - JPf?W'=K@M forbidden
Sodium

Prints Sodium - inspired by this answer.
12. Brainfuck - JPf?W'=K@M& forbidden
++[---------->+<]>.-[------>+<]>-.++++++.+++++++.---------.[--->+<]>----.----------.++++++++++++.--------.

Prints Magnesium - tested here.
13. JSFuck - JPf?W'=K@&M< forbidden
(+![]+[][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+([][[]]+[])[+[]]+((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]

Prints Aluminium - tested here.
14. Bash - JPf?W'=K@&M<[ forbidden
#!/bin/bash
echo "Silicon"

Prints Silicon.
15. Assembly NASM - JPf?W'=K@&M<[! forbidden
section .text
    global _start
section    .data
    msg db  "Phosphorus"
    len equ $ - msg
_start:
    mov edx, len
    mov ecx, msg
    mov ebx, 1
    mov eax, 4
    int 0x80
    mov eax, 1
    int 0x80

Prints Phosphorus- tested here.
16. D - JPf?W'=K@&M<[!$ forbidden
import std.stdio;void main(){write("Chlorine");}

Prints Chlorine.
17. Fortran '95 - JPf?W'=K@&M<[!$d forbidden
program C
    print *, "Argon"
end program C

Prints Argon - tested here.
18. Lua - JPf?W'=K@&M<[!$d* forbidden
print("Sul\x66ur")

Prints Sulfur - tested here.
19. Golfscript - JPf?W'=K@&M<[!$dt forbidden
U"\x50o\x74assium"

Prints Potassium - tested here.
20. Perl 5 - JPf?W'=K@&M<[!$*dU forbidden
use v5.10;
say "Calciu\x{6d}";

Prints Calcium - tested here.
21. Nimrod - JPf?W'=K@&M<[!$*dUu forbidden
echo  "Scan\x64i\x75m"

Prints Scandium.
22. Python - JPf?W'=K@&M<[!$*dUuh forbidden
print "Titani\165m";

Prints Titanium.
23. Unlambda - JPf?W'=K@&M<[!$*dUuh; forbidden
`r````.I.r.o.ni

Prints Iron. - tested here.
24. Forth - JPf?W'=K@&M<[!$*dUuh;`  forbidden
\
.( Cobalt) CR

Prints Cobalt - tested here.
25. Lua - JPf?W'=K@&M<[!$*dUuh;`\ forbidden
print("Nickel")

Prints Nickel - tested here
26. Emoticon - JPf?W'=K@&M<[!$*dUuh;`\p forbidden
Zinc :-Q

Prints Zinc- tested here
Oh well, I think that's about enough for me.

s/Nytrogen/Nitrogen/g; otherwise, nice job (and props for using Pascal, Fortran, and Assembly).


text:
Determine the move in which a LOGO turtle crosses a point that it has already visited
Situation:

A turtle starts at (0, 0) on a cartesian graph.
We have a non-empty zero-indexed "moves" list that contains numbers.
Each number represents the distance moved.
The first number is the distance north, the second is the distance east, the third is the distance south, the fourth is the distance west, and repeats like this forever. Therefore the directions cycle every four moves.

Goal:
Find an algorithm that gives the move number that makes the turtle cross a point that it has already visited before.
The move number is the index of the "moves" list.
This algorithm should preferably be O(n).
Example:
If given this move list: [1, 3, 2, 5, 4, 4, 6, 3, 2]
The move number answer is then 6. (It's the 7th move).
Draw it on a graph, the turtle will go:
(0,0) -> (0,1) -> (3,1) -> (3,-1) -> (-2,-1) -> (-2,3) -> (2,3) -> (2,-3)
At this 6 move number (7th move) it will meet (2,1) which is a point that the turtle has already crossed.
Example Implementation
Here was my try in PHP (I think it's kind of like O(n*(m+m)) where m is the average size of the distance):
/**
 * Logo Turtle Challenge
 * This solution is somewhat space inefficient, and could become time inefficient if the distance range for a particular move is huge!
 * There is probably a solution that allows you to persist only the corner coordinates and then using line equations to figure out if they intersect.
 * The space inefficiency could be partially solved with a lazy range generator.
 * Could be further micro-optimised by only checking the coordinates on the fourth[3] movement.
 */

function logo_turtle($movements) {

    $coordinates = [0 => [0 => true]];
    $current_coordinate = [
        'x' => 0,
        'y' => 0
    ];
    $directions = ['n', 'e', 's', 'w'];

    foreach($movements as $move => $distance){

        // cycle through the directions
        $current_direction = array_shift($directions);
        array_push($directions, $current_direction);

        // if the distance is less than 1, then skip it, but we still cycle the direction!
        if ($distance < 1) {
            continue;
        }

        // clean slate
        $coordinates_to_check = [];

        // for each direction, acquire a list of coordinates derived from its traverse
        // these coordinates will be used to check if turtle crosses its own previous path
        switch($current_direction){
            case 'n':

                $x_end = $current_coordinate['x'];
                $y_end = $current_coordinate['y'] + $distance;

                $start = $current_coordinate['y'] + 1;
                foreach(range($start, $y_end) as $value){
                    $coordinates_to_check[] = [ 'x' => $current_coordinate['x'], 'y' => $value];
                }

            break;
            case 'e':

                $x_end = $current_coordinate['x'] + $distance;
                $y_end = $current_coordinate['y'];

                $start = $current_coordinate['x'] + 1;
                foreach(range($start, $x_end) as $value){
                    $coordinates_to_check[] = [ 'x' => $value, 'y' => $current_coordinate['y']];
                }

            break;
            case 's':

                $x_end = $current_coordinate['x'];
                $y_end = $current_coordinate['y'] - $distance;

                $start = $current_coordinate['y'] - 1;
                foreach(range($start, $y_end) as $value){
                    $coordinates_to_check[] = [ 'x' => $current_coordinate['x'], 'y' => $value];
                }

            break;
            case 'w':

                $x_end = $current_coordinate['x'] - $distance;
                $y_end = $current_coordinate['y'];

                $start = $current_coordinate['x'] - 1;
                foreach(range($start, $x_end) as $value){
                    $coordinates_to_check[] = [ 'x' => $value, 'y' => $current_coordinate['y']];
                }

            break;
        }

        // if the traversal meets one of the existing coordinates, then the current move is an interception
        foreach($coordinates_to_check as $xy){

            if(
                isset(
                    $coordinates[
                        $xy['x']
                    ][
                        $xy['y']
                    ]
                )
            ){
                return $move;
            }

            // add the point to the list of coordinates that has been traversed
            $coordinates[$xy['x']][$xy['y']] = true;

        }

        // update the current coordinate for the next iteration
        $current_coordinate = [
            'x' => $x_end,
            'y' => $y_end
        ];

    }

    return -1;

}

$moves = [1, 3, 2, 5, 4, 4, 6, 3, 2];
$turtle_move = logo_turtle($moves); // returns 6

Criteria:

Feel free to write it in any language you want.
Winning algorithm is the first one that is published with an O(n) implementation.
With regards to algorithms with the same time complexity class, whichever code has the least amount of characters win.
Time limit is the best answer by 30th November 2014.

This is under-specified. Be especially clear in the winning criteria. How exactly is it scored? And the rest could be written more… "nicely".

@IngoBürk Ok I wrote it more clearly and added specifications for winning criteria. Is that alright, what else should I add?

The winning criteria are still unclear. What are these "extra points" you're mentioning? How many do we get and how exactly do they add to the score, since the score is a complexity class? Also, this is likely to end in ties, so you should have a tie breaker.

How would you suggest to score time complexity classes?

Are the moves always integers? If so, an extremely easy way to solve this is just to plot the path on a grid, and stop when you find a white pixel. O(n).

Yes they are always integers. Are you sure that's O(n), it sounds like for every move you have to check the grid. Isn't that what I did in the PHP implementation anyway?

@CMCDragonkai querying an array is a constant time operation

Well yes, but what are we talking about at this point? The array of grid points or the array of move points? Because I've used both. On every move, I query the grid points based on the move points. This is not really O(n) because on long distance moves, you'd have to check move point and it's hence O(n * m) where m is the average distance of moves.

For example, given array A as defined above, the function should return 7, because the turtle touches its previous path at point (2,1) in the 7th move.
Maybe it's newer task description, but now it asks to return 7 instead of 6.

C, O(n), 65 95 102 bytes
After I made at least one additional test case, some more code naturally needed to be added.
Thanks to Serge Mosin for finding another bug.
k(int*m){int*i=m;for(;2[i]>*i++;);for(*i-=i[~1]*(1[i]+(i-m>2)*i[~2]>=i[-1]);2[i]<*i++;);return 1+i-m;}

Test cases:
int a[] = {1, 3, 2, 5, 4, 4, 6, 3, 2}; // -> 6
int b[] = {4, 4, 5, 7, 8, 6, 5}; // -> 6
int c[] = {1, 1, 2, 1, 1}; // -> 4

Behavior is unspecified if there is a 0 in the array, since OP didn't specify whether that counts as the path crossing itself. Also, it is assumed that the path does cross at some point.
It might be undefined behavior to have 2[i] > *i++ but in code golf, that's like (negative) bonus points.
The first loop processes the part of the path that forms an outward spiral, which continues as long as each segment is longer than the previous parallel segment. The second loop traverses an inward spiral, in which each segment is shorter than the previous segment. At the beginning of the second spiral, there needs to be an adjustment to detect a possible collision with the previous stuff.

The counting is done in characters, not bytes. Since you claim O(n), it wouldn't matter anyway – it would be an automatic win.

Thanks for the answer! Could you explain a bit more what those 2 for loops are doing? Specifically I would a like to know how your algorithm works.

Just wanted to note that if the move is 0, then it means the turtle doesn't move anywhere, but the direction still cycles. That being said, it doesn't really matter now since I didn't specify it.

I added a different solution below which only uses one loop, would that count as being faster?

@ykay No, it is still O(n) which is the minimal time complexity for this problem.

@feersum Okay, what did you think of my solution?

@ykay I don't know, I'm allergic to Javascript and so can't tell what it does.

Here is a solution in JavaScript
function turtle(A) {
    for (i=3;i<A.length;i++) {
        if (A[i-1] <= A[i-3] && (A[i] >= A[i-2] || A[i-1] >= A[i-3]-(A[i-5] || 0) && A[i] >= A[i-2]-A[i-4] && A[i-2] >= A[i-4]))
            return i
    }
    return -1
}

Test Cases
var a = [1, 3, 2, 5, 4, 4, 6, 3, 2] // -> 6
var b = [4, 4, 5, 7, 8, 6, 5] // -> 6
var c = [1, 1, 2, 1, 1] // -> 4
var d = [1, 1, 2, 2, 4, 2, 1, 1, 2, 5, 10] // -> 8
var e = [1, 1, 1, 1] // -> 3
var f = [1, 1, 5, 3, 3, 2, 2, 1, 1, 3] // -> 9
var g = [1, 2, 2, 1, 1] // -> -1

Basically the turtle can only cross if the line from one time ago is less than or equal to the line from three times ago. Then check two cases, one where the current line is greater than or equal to the line from two times ago, and one where the current line crosses the line from five times ago.
The question doesn't specify what happens if the turtle moves 0. If that would be considered crossing his own path it would be easy to check for. If not, it would complicate things a bit.

For example, given array A as defined above, the function should return 7, because the turtle touches its previous path at point (2,1) in the 7th move. But your solution returns 6

@OlegAbrazhaev the array is 0 based so 6 is really the seventh move. -1 indicates that it doesn't cross it's path. You could change the code to return i + 1 and return 0 if you want.

I've made this teste just yesterday. This is my Objective-C version. It not meant to be the perfect, the latest and blah blah blah that Cordiality cries for, but a enough and readable version:
Its check the segment on vertical or horizontal to check if any previous drawn will be crossed.
https://gist.github.com/dbonates/818d6cea288a81cf888f
Hope it helps, if anyone wanna improve it feel free :)
Here goes the code as asked:
#import <Foundation/Foundation.h>

// Determine the move in which a LOGO turtle crosses a point that it has already visited

BOOL isBetween(int valueToTest, int limitOne, int limitTwo) {

    if (limitOne > limitTwo) {
        return (limitTwo <= valueToTest && valueToTest <= limitOne);
    } else {
        return (limitOne <= valueToTest && valueToTest <= limitTwo);
    }
}
int stepColistionCheck(NSMutableArray *stepsArray) {

    // NSLog(@"stepsArr: [%@]", [stepsArray componentsJoinedByString:@","] );

    int cx = 0;
    int cy = 0;

    int len = (int)[stepsArray count];

    // array with x and y position on grid
    NSMutableArray *deltaArray = [NSMutableArray array];

    for (int i=0; i<len; i++) {

        int direction = i%4;

        switch (direction) {
            case 0: // going NORTH
                cy -= [stepsArray[i] integerValue];
                [deltaArray addObject:@(cy)];
                break;

            case 1: // going EAST
                cx += [stepsArray[i] integerValue];
                [deltaArray addObject:@(cx)];
                break;

            case 2: //going SOUTH
                cy += [stepsArray[i] integerValue];
                [deltaArray addObject:@(cy)];
                break;

            case 3: //going WEST
                cx -= [stepsArray[i] integerValue];
                [deltaArray addObject:@(cx)];
                break;

            default:
                break;
        }
    }

    // array de deltas produzidos
    // NSLog(@"deltaArray: [%@]\n\n", [deltaArray componentsJoinedByString:@","] );

    // testing starting from third (the first that could colide, with the first vertical     in this case)
    for (int i=3; i< len; i++) {

        //check if will test horizontal colliding or vertical
        // 0, stands for vertical, 1 for horizontal
        int orientation = i%2;

        if (orientation == 0) { //vertical

            // the x value for this vertical segment is equal do the x from previous one
            int segmentX = [deltaArray[i-1] intValue];

            // NSLog(@"- testing vertical segment at index: %d, myX = %d:", i, segmentX);

            //loop from first horizontal to here
            // j is the horizontal segment
            int previousValue;

            for (int j=1; j < i; j+=2) {

                // first test, cant be adjacents
                if (j != (i-1) && j != (i+1)) {

                    if (j < 2) {
                        previousValue = 0;
                    } else {
                        previousValue = [deltaArray[j-2] intValue];
                    }

                    // trying to find if my x (segmentX) is between the values:     previousValue e [deltaArray[j] intValue]

                    if (isBetween(segmentX, [deltaArray[j] intValue], previousValue)) {

                        // NSLog(@"\tok, found candidate horizontal contains myX at     index %d", j);

                        // that horizontal segment contains my x,
                        // now I should check for y interpolation

                        // the y for current horizontal candidate for colision,
                        // is the y value before this index on delta array

                        int canditateY;
                        canditateY = [deltaArray[j-1] intValue];

                        // the Y of this horizontal segment found (canditateY), must me     in my y range, between [deltaArray[i] intValue] and [deltaArray[    i-2] intValue]

                        if (isBetween(canditateY, [deltaArray[i] intValue], [deltaArray[    i-2] intValue])) {
                            // the candidate Y has been found on current range of y for     this segment
                            // NSLog(@"\t\t***** FOUND SEGMENT THAT CROSS at index step     %d", (i+1));
                            return (i+1);
                        }
                    }
                }
            }

        }
        else if (orientation == 1) { //horizontal

            int segmentY = [deltaArray[i-1] intValue];

            // NSLog(@"- testing horizontal in index: %d, myY = %d:", i, segmentY);

            //loop from first vertical to here
            // j is the vertical segment
            int previousValue;

            // test which includes my x
            for (int j=0; j < i; j+=2) {

                if (j<1) {
                    previousValue = 0;
                } else {
                    previousValue = [deltaArray[j-2] intValue];
                }

                // first test, cant be adjacents
                if (j != (i-1) && j != (i+1)) {
                    if (isBetween(segmentY, [deltaArray[j] intValue], previousValue)) {

                        // NSLog(@"\tcandidate vertical contains myY at index %d", j);

                        // that vertical segment contains my y,
                        // now I should check for x interpolation

                        // the x for current vertical candidate for colision,
                        // is the x value before this index on delta array

                        int canditateX;
                        if (j<1) {
                            canditateX = 0;
                        } else {
                            canditateX = [deltaArray[j-1] intValue];
                        }

                        if (isBetween(canditateX, [deltaArray[i] intValue], [deltaArray[    i-2] intValue])) {
                            // the candidate X has been found on current range of x for     this segment
                            // NSLog(@"\t\t***** FOUND SEGMENT THAT CROSS at index step     %d", (i+1));
                            return (i+1);
                        }
                    }
                }
            }
        }

        // NSLog(@"- no colision with this segment");
    }

    return -1;
}

int main(int argc, char *argv[]) {
    @autoreleasepool {

        NSMutableArray *arr = [NSMutableArray arrayWithObjects: @7, @6, @9, @5, @8, @4,     @7, @3, @5, @2, @4, @1, @6, nil]; //return 13 // collide going to north

        printf("will collide on step %d", stepColistionCheck(arr));
    }
}

Thanks! What's the time complexity?

Please include the code in the answer to make it self-contained.

About time complexity I think It's O(n), as it will end immediately as soon it detects the first collision. Or will reach the end if no one collides.

Time complexity is O(n^2) here, you got nested loops

EDIT:
The bugs were found in this solution so don't use it. Refer to this one instead. Here is rich list of different test cases (including the one showing bugs in my solution).
int a[] = {1, 1, 1, 2}; // 3
int b[] = {1, 1, 2, 1, 1}; //4
int c[] = {1, 3, 2, 5, 4, 4, 6, 3, 2}; // 6
int d[] = {4, 4, 5, 7, 8, 6, 5}; // 6
int e[] = {1, 1, 2, 2, 4, 2, 1, 1, 2, 5, 10}; // 8
int f[] = {1, 1, 5, 3, 3, 2, 2, 1, 1, 3}; // 9 <-- this is the one I failed on

C, O(n), 82 bytes.
This is a fix for feersum's solution. I cannot write comments so I post it here as an answer:
k(int*m){int*i=m;for(;2[i]>*i++;);for(*i-=(i-m>2)*i[~1];2[i]<*i++;);return 1+i-m;}

Here is the case where his solution fails:
int a[] = {1, 1, 2, 2, 4, 2, 1, 1, 2, 5, 10};

His function returns 6, though the correct answer is 8.
All other notes about his solution are held here as well.

You're right that mine doesn't work... I seem to have multiplied two length values together, which hardly makes sense. This version fails my test case c though.

Indeed, my solution fails on your c test case and, what worse, on another type of routes I didn't think of (that's why I didn't use i[~2] as you did). I've provided test case that shows it.

Here is my approach done in Ruby, it uses Cramer's Rule to deduce if 2 segments cross each other.
Since we are dealing only with horizontal and vertical lines maybe its an overkill but it passed all the test cases.
https://gist.github.com/Janther/089b2a4338760c057cbf
def intersects?(p0, p1, p2, p3)
  s1_x = p1[0] - p0[0]
  s1_y = p1[1] - p0[1]
  s2_x = p3[0] - p2[0]
  s2_y = p3[1] - p2[1]

  denom = s1_x * s2_y - s2_x * s1_y
  # if denom == 0 lines are parallel
  # TODO: aditional check if they overlap
  return false if (denom == 0)

  denomPositive = denom > 0

  s3_x = p0[0] - p2[0]
  s3_y = p0[1] - p2[1]

  s_numer = s1_x * s3_y - s1_y * s3_x
  # s must be positive for posible colition
  # s = s_numer / demom
  return false if (s_numer < 0) == denomPositive

  t_numer = s2_x * s3_y - s2_y * s3_x
  # t must be positive for posible colition
  # t = t_numer / demom
  return false if (t_numer < 0) == denomPositive

  # both t and s must be <= 1 so |s_numer| <= |denom| AND |t_numer| <= |denom|
  (s_numer <= denom) == denomPositive && (t_numer <= denom) == denomPositive
end

def solution(a)
  path = [[0, 0]]
  directions = [[0, 1], [1, 0], [0, -1], [-1, 0]]

  a.each.with_index do |steps, solution_index|
    position = path.last
    direction = directions[solution_index % 4]

    path << [position[0] + steps * direction[0], position[1] + steps * direction[1]]

    next if path.size < 4

    end_segment_1   = path[path.size - 1]
    # Border case when the path ends at the beginning
    return solution_index + 1 if end_segment_1 == [0, 0]
    start_segment_1 = path[path.size - 2]

    # First check is 4 moves ago
    start_segment_0 = path[path.size - 5]
    end_segment_0   = path[path.size - 4]

    if intersects?(start_segment_0, end_segment_0, start_segment_1, end_segment_1)
      return solution_index + 1
    end

    next if path.size <= 6
    # Second check is 6 moves ago
    start_segment_0 = path[path.size - 7]
    end_segment_0   = path[path.size - 6]

    if intersects?(start_segment_0, end_segment_0, start_segment_1, end_segment_1)
      return solution_index + 1
    end

  end
  0
end

solution [1, 3, 2, 5, 4, 4, 6, 3, 2] #=> 7
solution [1, 1, 1, 2] #=> 4
solution [1, 1, 2, 1, 1]  #=> 5
solution [4, 4, 5, 7, 8, 6, 5] #=> 7
solution [1, 1, 2, 2, 4, 2, 1, 1, 2, 5, 10] #=> 9
solution [1, 1, 5, 3, 3, 2, 2, 1, 1, 3] #=> 10

Explanation of intersects?
We have 2 segments represented by p0, p1 and p2, p3.
Let's call the vector that joins p0 and p1 "s1" and the vector that joins p2 and p3 "s2".
s1 = p1 - p0
s2 = p3 - p2

Then we can represent the 2 lines by using the starting point and the vector like this:
L1 = p0 + t * s1
L2 = p2 + s * s2

If the two lines were to cross each other we should find a single value for t and s that fulfils the following equation
p0 + t * s1 = p2 + s * s2

If we cross multiply each side with s1 we get
(p0 + t * s1) x s1 = (p2 + s * s2) x s1

Since s1 x s1 = 0
(p0 - p2) x s1 = s * (s2 x s1)

And finally
s = (p0 - p2) x s1 / (s2 x s1)

Let's follow the same steps to solve for t
(p0 + t * s1) x s2 = (p2 + s * s2) x s2
t * (s1 x s2) = (p2 - p0) x s2
t = (p2 - p0) x s2 / (s1 x s2)

Having s1 x s2 = - (s2 x s1)
t = (p0 - p2) x s2 / (s2 x s1)

We have 2 equations
s = (p0 - p2) x s1 / (s2 x s1)
t = (p0 - p2) x s2 / (s2 x s1)

Since we don't want extra calculations let's have 2 more variables
denom = s2 x s1
s3 = p0 - p2

If denom is 0 segments are parallel and extra analysis should be made if they overlap.
If 0 ≤ t ≤ 1 AND 0 ≤ s ≤ 1 the lines cross inside the given segments, otherwise they cross in some other point.
Since floating point division is more CPU demanding than comparing 2 integers the code was modified to avoid dividing but still having the logic of 0 ≤ t ≤ 1 AND 0 ≤ s ≤ 1 and I added comments on the code to explain the logic.
Here you can find the original analysis which I used.
https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect

Could you explain a little about how you used cramer's rule?

I updated the answer with the whole approach plus the link where I took inspiration. I failed to see the point where cramer's rule is used, but the post says it was used.

Interesting, the other algorithms are catered to this turtle situation, but don't generalise to arbitrary lines, where there could be 0 distance moves, diagonal moves, or even non-turning moves. Perhaps a bentley-ottman algorithm would be needed.

Ah yes "polygonal chain" was the phrase I was looking for.

Just adding my php solution, runs in O(n):
$arr = [1, 3, 2, 5, 4, 4, 6, 3, 2];

$sol = solution($arr);
var_dump($sol);

function solution($arr) {
    $state = 0;
    $dmax  = 0;
    $arrCount = count($arr);

    for($i = 2; $i < $arrCount; $i++) {
        switch ($state) {
            case 0:
                if($arr[$i] <= $arr[$i-2]) {
                    $dmax = ($i >= 4 && $arr[$i-4] >= $arr[$i-2]) ? $arr[$i-1] - $arr[$i-3] : $arr[$i-1];
                    $state = 1;
                }
                break;

            case 1:
                if ($arr[$i] >= $dmax) {
                    return $i+1;
                } else {
                    $dmax = $arr[$i-1];
                }
                break;

        }
    }
    return -1;
}

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Organize Halloween Candy - Hole #4
See Hole #1 if you are confused.
What does every kid do after he/she collects buckets of candy over Halloween?
Sort it by type and size, of course1!
The Challenge
Given a dumped-out bag of candy of varying shapes and sizes, sort the candy from left to right based on:

First: The amount of candy (so 5 of one will be more left than 4 of another)
Second (if there are any ties after the first): If the amount is the same, the candy with more internal area (based on number of characters) will rank higher.

If after the second sort there is still a tie, then you may choose either to be first.
Input
You will be given the candy through stdin; strewn about. See examples below.
Output
Output the candy ordered in the correct order. Note, candy should always be placed in very neat columns to appease your OCD fish2. The candy of the same type should be placed directly under one another. See examples below.
What do you mean by "interior area"?

The interior area of a piece of candy is measured by the total characters making up the candy as a whole.
Any whitespace within a "border" is considered part of the area of the candy.
A border is any connected loop of characters, each character diagonal or next to it's neighbor.

For example,
+--------+
|        |
|        |
|        |
|        |
+--------+

has more area than
XXXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXXX

even though is has less characters overall.
Examples
input:
                       _           \|            |/                                     _
    _               lllllll        -*------------*-            -\       /-           lllllll
 lllllll           lllllllll        |  /\  /\  / |             +|\ooooo/|+          lllllllll
lllllllll          llll+llll        | /  \/  \/  |             ||o     o||          llll+llll
llll+llll          lllllllll       -*------------*-            ||o     o||          lllllllll
lllllllll           lllllll        /|            |\            +|/ooooo\|+           lllllll
 lllllll               |                                       -/       \-              |
    |                  |                _                                               |
    |   -\       /-    |             lllllll                                            |
    |   +|\ooooo/|+    |            lllllllll                                           |
    |   ||o     o||    |            llll+llll                                           |
    |   ||o     o||    +            lllllllll                              rrr--rrr     +
    +   +|/ooooo\|+                  lllllll                                rr||rr
        -/       \-                     |                                   | || |
                                        |                                   | || |
                                        |                                   | || |
                                        |                                   | || |
                                        |            \|            |/       | || |
                                        +            -*------------*-       | || |
                                                      |  /\  /\  / |        | || |
                        -\       /-                   | /  \/  \/  |        | || |
                        +|\ooooo/|+                  -*------------*-       rr||rr
                        ||o     o||                  /|            |\      rrr--rrr
                        ||o     o||
                        +|/ooooo\|+
                        -/       \-

Would become
    _     \|            |/ -\       /- rrr--rrr
 lllllll  -*------------*- +|\ooooo/|+  rr||rr
lllllllll  |  /\  /\  / |  ||o     o||  | || |
llll+llll  | /  \/  \/  |  ||o     o||  | || |
lllllllll -*------------*- +|/ooooo\|+  | || |
 lllllll  /|            |\ -/       \-  | || |
    |                                   | || |
    |     \|            |/ -\       /-  | || |
    |     -*------------*- +|\ooooo/|+  | || |
    |      |  /\  /\  / |  ||o     o||  | || |
    |      | /  \/  \/  |  ||o     o||  rr||rr
    +     -*------------*- +|/ooooo\|+ rrr--rrr
          /|            |\ -/       \-
    _
 lllllll  \|            |/ -\       /-
lllllllll -*------------*- +|\ooooo/|+
llll+llll  |  /\  /\  / |  ||o     o||
lllllllll  | /  \/  \/  |  ||o     o||
 lllllll  -*------------*- +|/ooooo\|+
    |     /|            |\ -/       \-
    |
    |
    |
    |
    +

    _
 lllllll
lllllllll
llll+llll
lllllllll
 lllllll
    |
    |
    |
    |
    |
    +

    _
 lllllll
lllllllll
llll+llll
lllllllll
 lllllll
    |
    |
    |
    |
    |
    +

A second example:
                   qq                                                                 \/
                   qq                 qq      qq                                    +-----+
                                      qq      qq         qq                       +       |
 jjjjjjjj                                                qq         qq            |       |
  jjjjjj             \/                                             qq      qq    |       |
   jjjj            +-----+ <---notice that the left side is not connected   qq    +-------+
  jj  jj         +       |       <-->       <-->
 j      j        |       |
jj  <>  jj       |       |       <-->                                 qq            jjjjjjjj
 jj    jj        +-------+                                            qq             jjjjjj
   jjjj                                 qq           qq                               jjjj
                                        qq           qq                              jj  jj
                                                                                j      j
                      +---------------------------------------------------------+  jj  <>  jj
      ooooo           +---------------------------------------------------------+   jj    jj
     o     yyyyyy                                                                     jjjj
     o           ww - notice diagonal border, allowed
     o           ww                                                 jjjjjjjj
     o     yyyyyy          ooooo                ooooo                jjjjjj
      ooooo               o     yyyyyy         o     yyyyyy           jjjj
                          o           ww       o           ww        jj  jj
                          o           ww       o           ww       j      j
                          o     yyyyyy         o     yyyyyy        jj  <>  jj
                           ooooo                ooooo               jj    jj
                                                                      jjjj

Solution:
qq  ooooo          jjjjjjjj  <-->     \/    +---------------------------------------------------------+
qq o     yyyyyy     jjjjjj          +-----+ +---------------------------------------------------------+
   o           ww    jjjj    <--> +       |
qq o           ww   jj  jj        |       |
qq o     yyyyyy    j      j  <--> |       |
    ooooo         jj  <>  jj      +-------+
qq                 jj    jj
qq  ooooo            jjjj             \/
   o     yyyyyy                     +-----+
qq o           ww  jjjjjjjj       +       |
qq o           ww   jjjjjj        |       |
   o     yyyyyy      jjjj         |       |
qq  ooooo           jj  jj        +-------+
qq                 j      j
    ooooo         jj  <>  jj
qq o     yyyyyy    jj    jj
qq o           ww    jjjj
   o           ww
qq o     yyyyyy    jjjjjjjj
qq  ooooo           jjjjjj
                     jjjj
qq                  jj  jj
qq                 j      j
                  jj  <>  jj
qq                 jj    jj
qq                   jjjj

Note that columns have 1 character of spacing between them, and are aligned horizontally at the top. Also note that each candy is in an exact columns, each candy with 1 character of spacing in between.
Scoring
This is code-golf, so shortest program (in bytes) wins.
1 What else would you do? Obviously you want to display your awesome might and power in the amount of candy you collected, right?
2 I know what you're thinking! A fish has to look through a curved bowl at your candy, so therefore it would be distorted anyway! Well, my fish lived (before it died) in a rectangular aquarium.

Since the left side is not connected, is the area only the boundary thickness X circumference ?

@Optimizer yes, though there might be variation in the border thickness across a piece of candy. The example above has area 24.

Ruby, 928 characters
Whew, this one was fun!
w=[];b=' ';u=$<.read.split'
';k=->l,z,t,p{loop{y=!!1;z.each{|c|t.each{|o|v=[c[0]+o[0],c[1]+o[1]]
y=!(z+=[v])if v[0]>=0&&v[1]>=0&&v[0]<l.size&&v[1]<l[0].size&&p[l[v[0]][v[1]]]&&!z.index(v)}}
break if y};z};(y=y;z=k[u,[[u.index{|p|y=p.index /\S/},y]],([-1,0,1].product([-1,0,1])-[0,0]),->x{x!=b}]
n=z.min_by{|c|c[0]}[0];m=z.min_by{|c|c[1]}[1];q=Array.new(z.max_by{|c|c[0]}[0]-n+1){b*(z.max_by{|c|c[1]}[1]-m+1)}
z.each{|c|q[c[0]-n][c[1]-m]=u[c[0]][c[1]];u[c[0]][c[1]]=b};w+=[q])while u*''=~/\S/;o=Hash.new 0;w.each{|c|o[c]+=1}
p=->q{e=k[q,((0...q.size).flat_map{|x|[[x,0],[x,q[0].size-1]]}+(1...q[0].size-1).flat_map{|y|[[0,y],[q.size-1,y]]}).select{|c|q[c[0]][c[1]]==b},[[0,1],[0,-1],[1,0],[-1,0]],->x{x==b}]
(q.size*q[0].size)-e.size};r=o.sort_by{|k,v|v+(p[k]/1e3)}.reverse.map{|k,v|(k+[b*k[0].size])*v}
r.map!{|k|k+([b*k[0].size]*(r.max_by(&:size).size-k.size))};puts ([b]*r.max_by(&:size).size).zip(*r).map{|r|r.join(b)[2..-1]}

You can give the input on STDIN, or you can pass an input file as an argument (like ruby organize.rb candy.txt) and it will treat the file as STDIN automatically.
All semicolons can be replaced with newlines; I just glued some lines together to reduce vertical space.
Ungolfed (2367 chars):
#!/usr/bin/ruby
input = $<.read.split("\n")
candies = []

# utility method
flood = -> arr, coords, offsets, cond {
    loop {
        changed = false
        coords.each{|c|
            offsets.each{|o|
                nc = [c[0]+o[0], c[1]+o[1]]
                if nc[0] >= 0 && nc[1] >= 0 && nc[0] < arr.length && nc[1] < arr[0].length &&
                    cond[arr[nc[0]][nc[1]]] && !coords.index(nc)
                    coords.push nc
                    changed = true
                end
            }
        }
        break if !changed
    }
    coords
}

# while there are non-whitespace characters in the pile
while input.join =~ /\S/
    # get coordinates of the first character to flood-fill on
    y = nil
    x = input.index{|row| y = row.index /\S/ }

    # flood-fill on that character
    coords = flood[input, [[x, y]], ([-1,0,1].product([-1,0,1]) - [0, 0]), ->x{x != ' '}]

    # x = max, n = min
    xx = coords.max_by{|c| c[0] }[0]
    nx = coords.min_by{|c| c[0] }[0]
    xy = coords.max_by{|c| c[1] }[1]
    ny = coords.min_by{|c| c[1] }[1]

    # create a properly sized thingy for this one candy
    candy = Array.new(xx - nx + 1) {
        ' ' * (xy - ny + 1)
    }

    # fill the thingy, while also removing it from the pile
    coords.each{|c|
        candy[c[0] - nx][c[1] - ny] = input[c[0]][c[1]]
        input[c[0]][c[1]] = ' '
    }

    candies.push candy
end

# group by same candies
candytypes = Hash.new 0
candies.each{|c| candytypes[c] += 1 }

area = -> candy {
    # we want to eliminate surrounding spaces
    # so flood-fill all spaces that touch the edges
    surround = (0...candy.length).flat_map{|x| [[x, 0], [x, candy[0].length-1]] } +
        (1...candy[0].length-1).flat_map{|y| [[0, y], [candy.length-1, y]] }
    surround.select! {|c| candy[c[0]][c[1]] == ' ' }
    surround = flood[candy, surround, [[0,1],[0,-1],[1,0],[-1,0]], ->x{x == ' '}]

    # now just subtract amount of surrounding spaces from total amount of chars
    (candy.length * candy[0].length) - surround.length
}
columns = candytypes.sort_by {|k, v|
    # this is a pretty ugly hack
    v + (area[k] / 1000.0)
}.reverse.map{|k, v| (k + [' ' * k[0].length]) * v }
columns.map!{|k| k + ([' ' * k[0].length] * (columns.max_by(&:length).length - k.length)) }

puts ([' '] * columns.max_by(&:length).length).zip(*columns).map{|r| r.join(' ')[2..-1] }

Finally an answer to this! Nice work ;)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/