text:
How many ways to write N as a product of M integers?
Given an integer N, count how many ways it can be expressed as a product of M integers > 1.
Input is simply N and M, and output is the total count of distinct integer groups. Meaning you can use an integer more than once, but each group must be distinct (3 x 2 x 2 would not count if 2 x 2 x 3 is present).
Constraints
1 < N < 231
1 < M < 30
Examples
Input 30 2 gives output 3, since it can be expressed 3 ways:
2 x 15
3 x 10
5 x 6

Input 16 3 gives output 1, since there's only one distinct group:
2 x 2 x 4

Input 2310 4 gives output 10:
5 x 6 x 7 x 11
3 x 7 x 10 x 11
3 x 5 x 11 x 14
3 x 5 x 7 x 22
2 x 7 x 11 x 15
2 x 5 x 11 x 21
2 x 5 x 7 x 33
2 x 3 x 11 x 35
2 x 3 x 7 x 55
2 x 3 x 5 x 77

Input 15 4 gives output 0, since it cannot be done.
Rules
Standard code golf loopholes apply, along with standard definitions for input/output. Answers may be a function or full program. Built-in functions for factorization and/or partitioning are not allowed, but others are fine. Code is counted in bytes.

What do you mean by partitioning ?

@Optimizer Grouping a list into nonoverlapping sublists. Some languages have this built in, such as Mathematica.

Is there a time limit? A particularly naive algorithm could take centuries for a large value of M. Simple things like noting there can only be one factor larger than sqrt(N) obviously help a lot.

@steveverrill Given the upper limit on N, there should only be 30 (prime) factors max, which speeds things up quite a bit. However, feel free to be naive. If your algorithm is not likely to provide an answer within a few hours, a well-explained proof of concept could help voters decide.

a built in which allows you to do cartesian product of two list is allowed ?

@Optimizer Yes.

I assume that 1 is not a valid factor?

@FUZxxl Correct, see the examples and the opening sentence.

Pyth - 24 23 22 21 bytes
Not a complicated solution. Will be golfing more. Just takes cartesian product of lists and filters. Same strategy as @optimizer (I'm guessing because of his comment, didn't actually decipher that CJam) Thanks to @FryAmTheEggman for 2 bytes and trick with M.
Ml{m`Sdfqu*GHT1G^r2GH

Defines a function g with args G and H
M                    function definition of g with args G and H
 l                   length of
  {                  set (eliminates duplicates)
   m                 map
    `Sd              repr of sorted factors so can run set (on bash escape ` as \`)
    f                filter
     q      G        equals first arg
      u*GHT1         reduce by multiplication
     ^     H         cartesian product by repeat second arg
       r2G           range 2 to first arg

Worked on all test args except last, was too slow on that one but there is no time limit given.

Input is fine in that format.

Pyth golf tip: if you get 2 arguments, it is usually shorter to use M which defines the function g of 2 arguments, G and H. This is what I get for this: Ml{msdfqu*GHT1G^r2GH. Always nice to see another Pyth user :)

@FryAmTheEggman updated thanks for the tip.

This seems to give an incorrect answer for the input 72 3, which returns 5, but there are in fact 6 answers, (2, 2, 18), (2, 3, 12), (2, 4, 9), (2, 6, 6), (3, 3, 8)

@isaacg oh ok, I'll revert it back to my 21 char version. I didn't think summing it would work but it seemed to, so i'll go back to repr. Thanks for the catch.

The above comment should have said (2, 2, 18), (2, 3, 12), (2, 4, 9), (2, 6, 6), (3, 3, 8), (3, 4, 6).

Python 3, 59
f=lambda N,M,i=2:i<=N and f(N/i,M-1,i)+f(N,M,i+1)or-~M==N<2

We count up potential divisors i. With the additional argument i as the lowest allowed divisor, the core recursive relation is
f(N,M,i)=f(N/i,M-1,i)+f(N,M,i+1)

For each i, we either choose to include it (possible as a repeat), in which case we divide the required product N by i and decrement M. If we don't, we increase i by 1, but only if i<N, since there's no use checking divisors greater than N.
When the minimum divisor i exceeds N, there's no more potential divisors. So, we check if we've succeeded by seeing if M==0 and N==1, or, equivalently, M+1==N==1 or M+1==N<2, since when M+1==N, the mutual value is guaranteed to be a positive integer (thanks to FryAmTheEggman for this optimization).
This code will cause a stack overflow for N about 1000 on most systems, but you can run it in Stackless Python to avoid this. Moreover, it is extremely slow because of its exponential recursive branching.

I think you can use -~M==N<2

@FryAmTheEggman I thought that would give false positives, but indeed it works, thanks to the joint constraints on M and N. Thanks!

Ruby, 67
f=->n,m,s=2,r=0{m<2?1:s.upto(n**0.5){|d|n%d<1&&r+=f[n/d,m-1,d]}&&r}

Actually reasonably efficient for a recursive definition. For each divisor pair [d,q] of n, with d being the smaller one, we sum the result of f[q,m-1]. The tricky part is that in the inner calls, we limit factors to ones greater than or equal to d so that we don't end up double-counting.
1.9.3-p327 :002 > f[30,2]
 => 3
1.9.3-p327 :003 > f[2310,4]
 => 10
1.9.3-p327 :004 > f[15,4]
 => 0
1.9.3-p327 :005 > f[9,2]
 => 1

CJam, 48 bytes
This can be a lot shorter but I have added certain checks to make it work for decent number of M on the online compiler.
q~\:N),2>{N\%!},a*{_,2/)<m*{(+$}%}*{1a+:*N=},_&,

Try it online here

This is buggy. Try input 2 1. Expected output: 1. Actual output: 0.

@PeterTaylor Sigh. Fixed.

T-SQL 456 373
I'm sure this'll break when the inputs are even close to being large.
Thanks to @MickyT for helping to save a lot of characters with CONCAT and SELECTing instead of multiple SETs.

CREATE PROC Q(@N INT,@M INT)AS
DECLARE @ INT=2,@C VARCHAR(MAX)='SELECT COUNT(*)FROM # A1',@D VARCHAR(MAX)=' WHERE A1.A',@E VARCHAR(MAX)=''CREATE TABLE #(A INT)WHILE @<@N
BEGIN
INSERT INTO # VALUES(@)SET @+=1
END
SET @=1
WHILE @<@M
BEGIN
SELECT @+=1,@C+=CONCAT(',# A',@),@D+=CONCAT('*A',@,'.A'),@E+=CONCAT(' AND A',@-1,'.A<=A',@,'.A')END
SET @C+=CONCAT(@D,'=',@N,@E)EXEC(@C)

I'd like to upvote this, but I can't find a simple way to test it. Any ideas? Third-party confirmation that it works is good, too.

I get a couple of conversion errors we I run it (2012).  They appear to be from these statements SET @C+=',# A'+@ and SET @D+='*A'+@+'.A'SET @E+=' AND A'+(@-1)+'.A<=A'+@+'.A'

You'll also need to fix SET @C+=@D+'=@N'+@E+' SELECT @'.  The @N is inside the quotes making it outside the scope when you execute @C.  Also I think you will end up counting duplicates

Now I've tested it on 2012. It should work.

Works good now :) A couple of place where you can shave some characters.  Try using CONCAT to build your strings.  Then you can drop the CONVERTs.  Try SELECT @+=1,@C+=CONCAT(...),@D+=CONCAT(...),@E+=CONCAT(...) in your WHILE loop.  Should save you a reasonable number

Jelly, 10 bytes
ḍƇ`ḊœċP€ċ⁸

Try it online!
Assumes that "Built-in functions for factorization and/or partitioning are not allowed" doesn't prohibit the œċ builtin, which is combinations with replacements. If this isn't allowed, we can use a Cartesian product builtin, which is allowed, for 12 bytes: ḍƇ`ḊṗṢ€QP€ċ⁸
How it works
ḍƇ`ḊœċP€ċ⁸ - Main link. Takes n on the left and m on the right
 Ƈ         - Filter the integers, k, between 1 and n where the following is true:
ḍ          -   Does k divide...
  `        -   ...n?
           - This gives a list of divisors
   Ḋ       - Remove the first value, 1
    œċ     - Take all combinations of length m, with replacement
      P€   - Take the product of each
        ċ⁸ - Count occurrences of n

source: Stack Exchange

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

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

sort: votes


text:
Chess Light Solver
Challenge
Write a solver for the Chess Light puzzle game, in the smallest amount of code.
The input will be a representation of a chessboard, how in yours is up to you. My examples below is textual, in which some squares may already be occupied by black peices. Some of the unoccupied squares are designated with a #, along with a list of white men to be placed. The goal is to place those men within the designated squares in such a way that every designated square is lit.
A chess piece lights up the squares which it attacks, including those occupied by men of the same colour but not those which have an interposing man, and not the one which it occupies itself. For example queen diagnol attack stops at the square occuppied by another peice and no further.
E.g. with the following board, the * show the squares which are lit. Q's square is unlit, but Q lights R's square. The squares labelled - would be lit except that R is between them and Q.
+--------+
|*    * -|
|*    *- |
|*****R**|
|*   **  |
|*  * *  |
|* *  *  |
|**   *  |
|Q*******|
+--------+

There is one important exception: a chess piece under attack by a man of the opposite colour doesn't light up any squares, it still block the light of others passing thru.
Note that pawns light up the following squares.
White Pawn
 * *
  P

Black Pawn
  p
 * *

Thus there is no en passant.

White is playing up the board.
Only one man is allowed on a square.
All pieces assigned to be placed must be placed on the board
An attacked piece, even if defended, is still attacked, but the defender does light up that square.
White's men are denoted with capital letters and black's with lower-case letters: KQRNBP and kqrnbp, where Nn are kNights.

The output (of mine) consists of a list of squares in the same order as the men listed in the input, using algebraic notation. Yours is up to you.
* There could be no answer!

Examples
Beginner (1)
+--------+
|        |
|  #     |
|  #     |
|  #  #  |
| ###### |
|  #  #  |
|     #  |
|        |
+--------+
RR

RR are the pieces to be placed on the board.
Solution C4, F4
Class B (19)
+--------+
|        |
|  r     |
|        |
|  ### b |
|  ###   |
|  ###   |
|  ###   |
|        |
+--------+
PPPK

PPPK are the pieces to be placed on the board.
Solution D4, E4, E2, D3
Since the output is in the same order as the men, the white king is placed on d3 and the other three squares receive white pawns.

Must all pieces be placed in a valid solution? Can pawns move in both directions or only one?

@MartinBüttner Updated the challenge

Its still very unclear. What is the significance of lighting up * from the first example ? Can we place the pieces on any # . If yes, what challenge is it ?

@Optimizer It's not a example board but showing the blocking of the "light" by another piece on the board. White's pieces can only be placed on # squared.

@Optimizer The challenge of the challenge is when placing a piece on the board, it affects what is already being lit by the other pieces already on the board.

I've rewritten to put the goal at the start, so that the first half of the question has context. But there are some things which I'm unsure about. When you say that all of White's men must be placed on the board, is there an implicit statement that the men to place will only be white? Do you require the input to have the border, or can answers dispense with that? What choice of delimiters is there for the output? What about case sensitivity in the output? (Lower-case is more common than capitals in algebraic notation, but you use capitals in your examples).

An important one: do your two examples cover all of the corner cases (e.g. attacked men not lighting anything up, men not lighting their own squares)? And what should the output be if there is no solution, or may answers assume that this will never be the case?

If a man is threatened by the king, but defended by another man, does that count as being attacked?

@MartinBüttner yes.

@AdamSpeight I'm going to vote to reopen, but it would be great if you could mention that case specifically in the challenge spec.

@PeterTaylor representation of input and output is user defined. Never assume a solution, but puzzles i've seen do.

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


text:
Resistent counter
You just have to ouput exactly all the numbers from 1 to 10 separated by spaces.
Your programme should work all the times even if a random character is deleted before compiling/interpreting.
This is code-golf so shortest code in bytes win!

What is the winning criteria ?

Related

@Optimizer codegolf, sorry if I forgot to mention it.

This is really tough in CJam at least ..

I voted to close as a duplicate of Fault-Tolerant Hello World. The conditions are same, and the required output is "0 1 2 3 4 5 6 7 8 9 10" rather than "Hello world". I understand that this is code golf and in theory allows a loop strategy (though I suspect it's impractical compared to hardcoding the string), so you might consider it sufficiently different. Still, I consider the core idea too similar to justify another such question.

Is it alright if it gives an error after it prints the numbers when some of the chars are removed or prints garbage after the numbers?

@xnor I think that this is fairly different. Only the Befunge answer can be reused here (not sure about the Perl one) . Plus, in this question, you cannot have an answer with a fault. It should have score 0 as per the other question. All answers of this question can be used into the other one, though.

@xnor That question wasn't code-golf but code-challenge. It's related but not duplicate imo. Looping is quite shorter for me in fish. (Looping might even add some resistant in some cases. Might not.) Idk though how viable complete resistance is in other languages.


text:
Emulate Rule 110 with Conway's Game of Life (or vice versa)
Can you find initial conditions for either Rule 110 or Conway's Game of Life to emulate the other? That is, produce output (in any form, not necessarily the familiar pixel grid) which corresponds directly to the other.
Rule 110 takes an infinite one-dimensional binary array as input, and outputs an infinite one-dimensional binary array using the values in the input array for the same position and the positions to the left and right, according to the following rules:
Input:   111    110    101    100    011    010    001    000
Output:   0      1      1      0      1      1      1      0

Example:

Conway's Game of Life takes an infinite two-dimensional binary matrix as input, and outputs an infinite two-dimensional binary matrix according to the following rules:

Any live cell with fewer than two live neighbours dies, as if caused by under-population.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overcrowding.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

Example:

Challenges:

How do you find initial conditions to match a specific output, when slightly different inputs produce vastly different outputs?
How do you map infinite structures of different dimensions to each other?
Do you have to throw away a lot of output to get the relevant bits from the other automaton?

@KSFT It's possible. a) The set of 2D integer coordinates is countable, so you can assign a single integer to each of them. b) Both Rule 110 and the Game of Life have been shown to be Turing complete, so you could just implement one of them in a Turing machine and then implement that Turing machine in the other.

@MartinBüttner In theory, yes. Practically, that's nearly impossible.

Since we can emulate Conway's Game of Life with Conway's Game of Life (http://www.conwaylife.com/wiki/OTCA_metapixel ), I think this is not so difficult.

@Ypnypn Agreed. I don't see this getting answered any time soon, much like the Game of Life Tetris challenge.

Here is an answer by Jason Summers in 2005: http://pentadecathlon.com/lifeNews/2005/12/rule_110_unit_cell.html

I know this question is old and rules have changed, but I am voting to close this as off-topic, because as it stands the [popularity-contest] requires some goal for humans to arbitrate over, and this provides none.  Interesting challenge but it needs a criterion.


text:
Code Golf: Gibberish Echo
This is my first code golf challenge, as such I am not entirely certain if it is suitable as a Code Golf challenge, but it's all a learning experience.
The challenge is that in as few characters as possible, using whichever language you prefer, develop a code to complete the following:

Take a value from stdin
Return a value to stdout that contains the same characters as the value at stdin in a different order. Not necessarily random, but following the restrictions set out below.

Here are a few restrictions:

All characters that are contained in the stdin value must appear in stdout value
Characters must appear in stdout the same amount of times they appear in stdin
The order of characters in the output, cannot be identical to the order of characters in input, for more than two consecutive characters. Regardless of the source of the character in the input. That is, the input and output must not have a common substring of length 3 or greater.
Any input where no solution can be found under the previous rule, is considered an invalid input
Examples: aaaa, bbbb
you do not need to test for invalid inputs, assume all inputs are valid.
The length of stdout must be the same as the length of stdin
You may use any method to scramble the initial value, there is nothing off limits here.

Example:

stdin: Hello There
stout: loTeHle reh

Note: a character in this context can be any valid ASCII character

CJam, 31 27 bytes
l:I{mr[_I]{_,((,\f>3f<}/&}g

Test it here.
Same approach as my Mathematica answer. It keeps generating random permutations of the input, until the substring restriction is satisfied. I think this can be golfed a bit further.

Mathematica, 89 bytes
(For[c=Characters@#;d=c,#⋂#2&@@(Partition[#,3,1]&/@{c,d})!={},d=RandomSample@c];d<>"")&

Generates random permutations until there is the permutation and the original have no common substring of length 3.

I don't think @"HelloThere" needs to be counted towards the size.

@KennyTM oh, thank you, totally forgot to remove that

CJam, 48 bytes
This is super huge. I am not sure if there are any good algorithms to do the task. This is just a brute force.
q:Q;{Q(+2/zs:R,3-_0>{,{RQI>3<#W>}fI}{;}?]1b0>}gR

Try it online here

for aacc, the program returned acca, which unforetunately fails the third restriction.


text:
Shortest code special string sort
Objective/Restrictions:

May only be answered with programming language that has function syntax (or procedure, method, lambda, macro, statement grouping and labelling) .

Create a function with at least 2 argument/parameter, that generates an array containing 7 random strings, each string contains 3 characters, string may only contain alphanumeric characters [a-zA-Z0-9]. The number 7 and 3 passed into the function

Create a function that sort those strings using in special alphabetical ascending order: number first, alphabet later (lower-case then upper-case), for example:
1aa
2ac
aab
abc
Aab
bAA
BZ2

Create a function to print each string in descending order from the last one to the first one without mutating the ascending ordered array.

Call all three function and produce the correct output

Shortest code wins!

Note: if possible, give the ideone (this one also example implementation in Ruby) or any other online compiler link to test the correctness.

care to explain why -1, and now -2?

All the restrictions and requirements seem arbitrary and thrown together. Because you're saying what each step needs to do, there's little room for cleverness. Your challenge looks decent and well-specified, but I wouldn't want to work on it. I'd prefer a task that just told me what task my code needed to achieve, meaning the connection the output must have to the input, and let me figure out the best way to do it.

people here are quite mean to me.. XD -5 now..

J - 70 chars
a=:'0123456789',6}.26|.a.{~65+i.58
b=:{&a@?@$&62
c=:/:62&#.@(a&i.)
d=:\:~

Usage: d c b 7 3

I was looking for ways to shorten your a, but I only found a.#~(0j48 10j7 26j6 26j133)#4$1, which has the same length.

@FUZxxl '0123456789' is (1":i.10), that's -3 chars

@FUZxxl 48}.a.#~(58j7 26j6 26j133)#3$1 saves 1 char on your idea

b=:a{~?@$&62, c=:/:a&i., and d=:|. are shorter. Further, this definition of a gives a flat-out wrong solution, because it sorts incorrectly. Try a=:(1":i.10),,97,.&(26$}.&a.)65.

Perl 5 - 181 chars
Ungolfed
@z=(0..9,a..z,A..Z);

sub d{
    map{ tr/A-Za-z/a-zA-Z/; $_ } @_
}

# n - number of strings to generate
# l - length of strings
sub a{
    ($n,$l) = @_;
    $a .= $z[rand@z] for 1..$n*$l;
    ($a=~/(.{$l})/g)
}

sub b{
    d(sort d(@_))
}

sub c{
    for(-$#_..0){
        print "$_[-$_]\n"
    }
}

c b a 7,3

Golfed
@z=(0..9,a..z,A..Z);sub d{map{tr/A-Za-z/a-zA-Z/;$_}@_}sub a{($n,$l)=@_;$a.=$z[rand@z]for 1..$n*$l;($a=~/(.{$l})/g)}sub b{d(sort d(@_))}sub c{for(-$#_..0){print"$_[-$_]\n"}}c b a 7,3

Perl6   145 chars
#! /usr/bin/env perl6

my@a='a'..'z';
my@b='A'..'Z';
my@c=^10,@a,@b;

# first argument $^a is the number of strings
# second argument $^b is the length of the strings
sub a{@c.roll($^b).join xx$^a};

# sub b{@_.sort} # numbers then upper then lower
sub b{@_.sort(*.trans(@a,@b Z=>@b,@a))}; # swaps upper and lower

sub c{say @_.reverse};

c b a 7,3

my@a='a'..'z';my@b='A'..'Z';my@c=^10,@a,@b;sub a{@c.roll($^b).join xx$^a};sub b{@_.sort(*.trans(@a,@b Z=>@b,@a))};sub c{say @_.reverse};c b a 7,3

After removing the comments and all of the newlines, I get 145 characters.
If the requirements were changed so that the strings were sorted by numbers then uppercase then lowercase, I could remove 25 characters from the b subroutine.

Ruby, 141
Fairly straightforward solution. Uses recursion to generate the random Strings and makes use of String#tr to make the sorting short and sweet.
O=[*?0..?9]+[*?A..?Z]+[*?a..?z]
r=->i,s{i<1?[]:([O.sample(s)*'']+r[i-1,s])}
s=->a{a.sort_by{|e|e.tr"A-Za-z","a-zA-Z"}}
p=->a{puts a.reverse}

Usage: p[s[r[7,3]]].

Ruby - 339 chars
X=[*('0'..'9')]+[*('a'..'z')].map{|c|[c,c.upcase]}.flatten
Y={};v=0;X.each{|c|Y[c]=(v+=1)}
def x n;n.times.to_a.map{X[(rand()*X.length).to_i]}.join '';end
def y m,n;m.times.to_a.map{x n};end
def z r;r.sort{|a,b|v=-1;w=0;a.each_char{|c|d=b[v+=1];next if c==d;w=(Y[c]<Y[d]?-1:1);break};w};end
def a b;b.reverse_each{|c|puts c};end
a z(y 7,3)

verify here

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


text:
User Scored Code Golf - Drawing Diamonds [experimental]
This challenge will behave more or less like a traditional code-golf. The only difference is that instead of scoring answers by their number of characters or bytes, users will assign
weights to different characters in the comments and the program with the lowest cumulative weight will win.
Challenge
Your task is to write a program that takes a string and prints a diamond shape where the first character starts in the center and subsequent characters occupy the empty spaces orthogonal to the set of characters that were placed last. Spaces ( ) will be used for padding.
For example inputting CAT would produce
  T
 TAT
TACAT
 TAT
  T

and () would produce
 )
)()
 )

and  desserts would produce
        s
       sts
      strts
     strerts
    streserts
   stressserts
  stressesserts
 stressedesserts
stressed desserts
 stressedesserts
  stressesserts
   stressserts
    streserts
     strerts
      strts
       sts
        s

and 9 would produce 9.
Details

The code may only contain printable ASCII and newlines. (See why below.)

Input/output should be via stdin/stdout, or, if they aren't possible, use similar alternatives.

You may assume the input string only contains printable ASCII (including space).

Columns of leading spaces not containing any portion of the diamond pattern are not allowed in the output. Any amount and combination of trailing spaces spaces is allowed.

There may optionally be a trailing newline in the output.

You may edit your answer as much as you want.

Scoring
All code must be written using only newlines and the 95 printable ASCII characters:
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
(Sadly tabs are not allowed because Stack Exchange renders them as spaces in code blocks.)
Each of these 96 characters has a weight value associated with it. By default, all the weights are 97.
The score of a program is the sum of the weight values for each of its characters. For example, if the program were print(4) and the weight for 4 was 70, but unchanged for everything else, the score would be 749 = 97+97+97+97+97+97+70+97.
Once the activity in this question settles down to almost nothing, the lowest scoring submission wins. In the presumably unlikely case of tie the wins goes to the highest voted answer.
Changing Weights
Every user, whether they've answered or not, can change the weight of one of the 96 characters to a unique value from 1 to 96. To do this, add a comment to this question of the form #### W -> C ####, where W is an integer from 1 to 96 and C is the character (as itself, no quotes, no backticks). Use \n in place of C for newlines and \s for space since Stack Exchange compresses 3 spaces in a row. The print(4) example above would have had the comment #### 70 -> 4 ####.
Each user may only make ONE comment like this, and it will only be valid if both the character and the weight value have not been used in a previously made comment. Thus eventually, there may be 96 #### W -> C #### comments, all from different users, all with different weights assigned to different characters.
Users may delete their own comment if they want to, resetting their characters' weight back to 97 until they or someone else comments again. They may also edit them. Comments not following the rules about distinct users/weights/characters should be deleted or flagged as "not constructive". General comments about rules and other things are fine but should be kept at a minimum.
This stack snippet is the official leaderboard for this question. It automatically computes the scores for all submissions by gathering the weights from comments each time it is run. It does not handle ties. You can also use it to check the score a program would have.
You'll probably need to right-click -> Open link in new tab for the links.

function compute(){var e=computeScore($("#code").val());$("#score").val(e==-1?"Invalid characters":e)}function computeScore(e){var t=0;for(var n=0;n<e.length;n++){if(weights.hasOwnProperty(e[n])){t+=weights[e[n]]}else{return-1}}return t}function htmlDecode(e){var t=document.createElement("div");t.innerHTML=e;return t.childNodes.length===0?"":t.childNodes[0].nodeValue}function addLeaderboard(){validAnswers.sort(function(e,t){return e.score>t.score});var e=1;var t="";for(var n=0;n<validAnswers.length;n++){var r=validAnswers[n];t+="
"+e+"	"+r.owner.display_name+"	"+r.score+"	"+r.length+"
";if(n+1<validAnswers.length&&validAnswers[n+1].score>r.score){e++}}$("#leaderboard").append(t)}function addAnalytics(){var e="";for(var t in weights){if(weights.hasOwnProperty(t)&&weights[t]!=defaultWeight){e+=(t=="\n"?"\\n":t)+"="+weights[t]+" "}}$("#weights").val(e);var n="";for(var t in usedChars){if(usedChars.hasOwnProperty(t)&&usedChars[t]==false){n+=t=="\n"?"\\n":t}}$("#unusedc").val(n);var r="";for(var t in usedWeights){if(usedWeights.hasOwnProperty(t)&&usedWeights[t]==false){r+=t+" "}}$("#unusedw").val(r);var i="";if(invalidComments.length>0){for(var s=0;s<invalidComments.length;s++){var o=invalidComments[s];i+=""+o.owner.display_name+" "}}else{i="none"}$("#comments").html(i);var u="";if(invalidAnswers.length>0){for(var s=0;s<invalidAnswers.length;s++){var a=invalidAnswers[s];u+=""+a.owner.display_name+" "}}else{u="none"}$("#answers").html(u)}function checkAnswers(e){for(var t=0;t<e.items.length;t++){var n=e.items[t];var r=answerPattern.exec(n.body);if(r){var i=htmlDecode(r[1]);var s=computeScore(i);if(s==-1){invalidAnswers.push(n)}else{n.length=i.length;n.score=s;validAnswers.push(n)}}else{invalidAnswers.push(n)}}addLeaderboard();addAnalytics()}function checkComments(e){for(var t=0;t<e.items.length;t++){var n=e.items[t];var r=commentPattern.exec(htmlDecode(n.body));if(r){var i=n.owner.user_id;var s=parseInt(r[1]);var o=r[2]=="\\n"?"\n":r[2]=="\\s"?" ":r[2];if(userIDs.hasOwnProperty(i)||!usedWeights.hasOwnProperty(s)||usedWeights[s]||!usedChars.hasOwnProperty(o)||usedChars[o]){invalidComments.push(n)}else{userIDs[i]=true;usedWeights[s]=true;usedChars[o]=true;weights[o]=s}}}$.get(answersURL,checkAnswers)}function refresh(){$.get(commentsURL,checkComments)}questionID=45040;commentsURL="https://api.stackexchange.com/2.2/questions/"+questionID+"/comments?order=asc&sort=creation&site=codegolf&filter=!t)IWLXOkOvAuPe8m2xJrXOknWcw(ZqZ";answersURL="https://api.stackexchange.com/2.2/questions/"+questionID+"/answers?order=desc&sort=activity&site=codegolf&filter=!.FjsvG2LuND(frE*)WTvqQev1.lyu";commentPattern=/^#### (\d+) -> (\\(?:n|s)|[ -~]) ####$/;answerPattern=/
((?:\n|.)*?)\n<\/code><\/pre>/;chars="\n !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";validAnswers=[];invalidAnswers=[];invalidComments=[];userIDs={};usedWeights={};usedChars={};weights={};defaultWeight=chars.length+1;for(var i=0;i<chars.length;i++){usedChars[chars[i]]=false;usedWeights[i+1]=false;weights[chars[i]]=defaultWeight}refresh()
*{font-family:Helvetica,Arial,sans-serif}table{border:3px solid green;border-collapse:collapse}button{font-size:100%}th{background-color:green;color:#fff;padding:6pt}td{border:1px solid green;padding:6pt}.large{font-size:140%}.title{font-weight:700;margin:6pt 0}textarea{font-family:"Courier New";white-space:nowrap;overflow:auto}input[readonly]{background-color:#dcdcdc}.analytics{font-size:90%;padding:4pt 0 0}

Leaderboard

 Place	 Submitter	 Score	 Program Length

Compute Score
<textarea id='code' rows='5' cols='40' placeholder='paste code here...'></textarea>
<button type='button' onclick='compute()'>Compute</button> Score: <input type='text' id='score' readonly>

Analytics

Assigned weights: <input type='text' id='weights' readonly>

Unused characters: <input type='text' id='unusedc' readonly> (all weight 97)

Unused weights: <input type='text' id='unusedw' readonly>

Invalid comments (duplicate user/char/weight):

Invalid answers (illegal characters or no code block):

<button type='button' onclick='refresh'>Refresh</button>

For this leaderboard to work, the comments must be in the exact format described above and your program's code must be in the first multi-line code block in your answer (the
...
 ones). Don't use syntax highlighting or your code won't be read correctly. The snippet can take a minute or two before it updates.
I have not tested the snippet thoroughly but I'll be keeping an eye on it as this contest gets underway. If you notice any bugs please tell me. Here is an non-minified version:

questionID = 45040

commentsURL = 'https://api.stackexchange.com/2.2/questions/' + questionID + '/comments?order=asc&sort=creation&site=codegolf&filter=!t)IWLXOkOvAuPe8m2xJrXOknWcw(ZqZ'

answersURL = 'https://api.stackexchange.com/2.2/questions/' + questionID + '/answers?order=desc&sort=activity&site=codegolf&filter=!.FjsvG2LuND(frE*)WTvqQev1.lyu'

commentPattern = /^#### (\d+) -> (\\(?:n|s)|[ -~]) ####$/
answerPattern = /
((?:\n|.)*?)\n<\/code><\/pre>/

chars = '\n !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'

validAnswers = []
invalidAnswers = []
invalidComments = []

userIDs = {}
usedWeights = {}
usedChars = {}
weights = {}
defaultWeight = chars.length + 1

for (var i = 0; i < chars.length; i++) {
    usedChars[chars[i]] = false
    usedWeights[i + 1] = false
    weights[chars[i]] = defaultWeight
}

function compute() {
    var score = computeScore($('#code').val())
    $('#score').val(score == -1 ? 'Invalid characters' : score)
}

function computeScore(code) {
    var score = 0
    for(var i = 0; i  b.score} )

    var place = 1
    var rows = ''

    for(var i = 0; i < validAnswers.length; i++) {
       var a = validAnswers[i]
       rows +=
           '
' + place +
           "	" + a.owner.display_name + "	" +
           a.score + '	' + a.length + '
'

       if (i + 1 < validAnswers.length && validAnswers[i + 1].score > a.score) {
           place++
       }
    }

    $('#leaderboard').append(rows)
}

function addAnalytics() {
    //assigned weights
    var assigned = ''
    for (var key in weights) {
        if (weights.hasOwnProperty(key) && weights[key] != defaultWeight) {
            assigned += (key == '\n' ? '\\n' : key) + '=' + weights[key] + ' '
        }
    }
    $('#weights').val(assigned)

    //unused chars
    var unusedc = ''
    for (var key in usedChars) {
        if (usedChars.hasOwnProperty(key) && usedChars[key] == false) {
            unusedc += key == '\n' ? '\\n' : key
        }
    }
    $('#unusedc').val(unusedc)

    //unused weights
    var unusedw = ''
    for (var key in usedWeights) {
        if (usedWeights.hasOwnProperty(key) && usedWeights[key] == false) {
            unusedw += key + ' '
        }
    }
    $('#unusedw').val(unusedw)

    //invalid comments
    var invalidc = ''
    if (invalidComments.length > 0) {
        for (var i = 0; i < invalidComments.length; i++) {
            var c = invalidComments[i]
            invalidc += "" + c.owner.display_name + ' '
        }
    } else {
        invalidc = 'none'
    }
    $('#comments').html(invalidc)

    //invalid answers
    var invalida = ''
    if (invalidAnswers.length > 0) {
        for (var i = 0; i < invalidAnswers.length; i++) {
            var a = invalidAnswers[i]
            invalida += "" + a.owner.display_name + ' '
        }
    } else {
        invalida = 'none'
    }
    $('#answers').html(invalida)
}

function checkAnswers(answers) {
    for (var i = 0; i < answers.items.length; i++) {
        var answer = answers.items[i]
        var match = answerPattern.exec(answer.body)
        if (match) {
            var code = htmlDecode(match[1])
            var score = computeScore(code)
            if (score == -1) {
                invalidAnswers.push(answer)
            } else {
                answer.length = code.length
                answer.score = score
                validAnswers.push(answer)
            }
        } else {
            invalidAnswers.push(answer)
        }
    }

    addLeaderboard()
    addAnalytics()
}

function checkComments(comments) {
    for (var i = 0; i < comments.items.length; i++) {
        var comment = comments.items[i]
        var match = commentPattern.exec(htmlDecode(comment.body))
        if (match) {
            var userID = comment.owner.user_id
            var weight = parseInt(match[1])
            var char = match[2] == '\\n' ? '\n' : (match[2] == '\\s' ? ' ' : match[2])

            //check validity
            if (userIDs.hasOwnProperty(userID) ||
                !usedWeights.hasOwnProperty(weight) || usedWeights[weight] ||
                !usedChars.hasOwnProperty(char) || usedChars[char])
            {
                invalidComments.push(comment)
            } else {
                userIDs[userID] = true
                usedWeights[weight] = true
                usedChars[char] = true
                weights[char] = weight
            }
        }
    }
    $.get(answersURL, checkAnswers)
}

function refresh() {
    $.get(commentsURL, checkComments)
}

refresh()
* {
    font-family: Helvetica, Arial, sans-serif;
}

table {
    border: 3px solid green;
    border-collapse: collapse;
}

button {
    font-size: 100%;
}

th {
    background-color: green;
    color: white;
    padding: 6pt;
}

td {
    border: 1px solid green;
    padding: 6pt;
}

.large{
    font-size: 140%;
}

.title{
    font-weight: bold;
    margin: 6pt 0 6pt 0;
}

textarea {
    font-family: "Courier New";
    white-space: nowrap; overflow: auto;
}

input[readonly]
{
    background-color: gainsboro;
}

.analytics {
    font-size: 90%;
    padding: 4pt 0 0 0;
}

Leaderboard

    Place
    Submitter
      Score
    Program Length

Compute Score

<textarea id='code' rows='5' cols ='40' placeholder='paste code here...'></textarea>

<button type='button' onclick='compute()'>Compute</button> Score: <input type='text' id='score' readonly>

Analytics

Assigned weights: <input type='text' id='weights' readonly>

Unused characters: <input type='text' id='unusedc' readonly> (all weight 97)

Unused weights: <input type='text' id='unusedw' readonly>

Invalid comments (duplicate user/char/weight):

Invalid answers (illegal characters or no code block):

<button type='button' onclick='refresh'>Refresh</button>

Keep in mind that this scoring system is completely new and experimental. Hopefully Stack Exchange won't mind that it involves tons of comments. :P
Related challenge: Print this diamond

1 -> *

Comments can be edited for 5 minutes, so allowing them to be edited could cause complete havok with the non-repetition rules.

@PeterTaylor But how can I possibly stop comment edits? Besides totally ignoring ones that are edited. 5 minutes goes pretty fast.

I don't like this scoring system at all (see chat), but if you're going to use it then ignoring comments which are edited is definitely the right thing to do.

2 -> :

3 -> 3

5 -> \s

6 -> (

7 -> @

8 -> [

9 -> =

93 -> +

94 -> )

25 -> b

95 -> '

stressed desserts

4 -> I

10 -> $

CJam, 144 150 bytes
"x*3:*3:3*::33:3:::333*::333*3::***3::**::33:3::3*:::::*3:3:3:**33*333333::33*:*333:*3*3**:**3:**:3*3:33*3:3*:333**:3**33:*3:::*:3*::3"'3/'b*3b127b:c~

Tried some encoding...
Updated because the weight of b has changed.
Another encoding which is only better in theory (140 bytes):
":***(*3:**3*I**:3*****:*3*******: ::::*:***II@3*******: :**I:**:***:*3***3*I3I:3***33:::*I**3I***3***:3:*I*3I"{"*:I3( **@"#1a*~0}%2b126b:c~

Python 2, 120 bytes
T=raw_input()
L=len(T)
r=[b[::-1]+b[1:]for b in [T[-b:]+' '*(L-b)for b in range(1,L+1)]]
for b in r[:-1]+r[::-1]:print b

Edit: Lowered cost with some cheaper characters.

Pyth, 21 bytes
L+_tbbjbymy+>zd*\ dlz

Try it online: Pyth Compiler/Executor

CJam, 31 bytes
lW%_,:I(S*\+I*I/2%{_W%1>+z}2*N*

Just an adaptation of my answer to Print this diamond for now. I might tweak it when the weights have changed.
Test it here.

J, 45 chars
(({~((]*]<#@[)>:@(+/~)@:|@i:@(2-#)))@(' '&,))

Longish solution, will golf it with some cheap chars...
Try it online. (Append input string with single quotes.)

PHP (131 chars)
function f($s){for($i=-($l=strlen($s));$i<$l;$I=abs(++$i)){$t=substr($s,$I);echo str_repeat(' ',$I).strrev($t).substr($t,1)."\n";}}

http://3v4l.org/9Vvkm
Will optimise once the weightings are clearer.

Your code may be rewritten into this: function f($s){for($i=-($l=strlen($s));$i<$l;)echo str_repeat(' ',$I=abs(++$i)),strrev($t=substr($s,$I)),substr($t,1),"\n";} which might not work. But it is 6 bytes shorter! Probably you might take something from here.

Vyxal j, 61 bytes, score 4890.
fK\a:-$vj:vL?Lv-\ v*$+?:L1-wifK\a:-$vjvm2v/vt\a:-p+:wRh1?L"iJ

Try it Online!
This was painful, especially in  a language with a huge codepage that I can  only use a small bit of.
Score calculation + explanation coming soon.
Thanks to lyxal for finding some clever ways for me to do various things.

Java, 318 bytes
class N{public static void main(String[]a){char[]s=new java.util.Scanner(System.in).nextLine().toCharArray();int l=s.length,m=l-1,$=0,b;String t="";for(;$<l;$++,t+='\n')for(b=0;b<l+$;b++)t+=b+$<m?' ':s[b>m?m-b+$:b+$-m];for($=l-2;$>-1;$--,t+='\n')for(b=0;b<l+$;b++)t+=b+$<m?' ':s[b>m?m-b+$:b+$-m];System.out.print(t);}}


text:
Print the content of /etc/passwd with constant creation limit
Rules/Objectives:

The program must be executed using ./program-name without shell parameter/arguments.
the program-name may not contain any of characters in /etc/passwd, that is acdepstw
You may not open any other file, including own's source code, only /etc/passwd that should be read.
The program must print the content the /etc/passwd file.
Total score of the code equal to number of characters in the code added with constant literal declaration point. Each byte of constant declaration literal equal to +100 to the score, after 3 declaration, each byte adds +200 to the score. So the program should not contain too many constant declaration, but you may use predeclared constants (M_PI for example) or exploit the reflection of the function/variable/class name (function, variable or class names in this case are not considered as constant). Counting example:
int x = 12;       // counted as 1 byte (12 can fit to 8-bit)
x += 345;         // counted as 2 bytes (345 can fit to 16-bit)
#define Y 'e'     // counted as 1 byte ('e')
#define X Y       // counted as 0 (not considered as constant)
string s = "abc"; // counted as 3 bytes ("abc")
:foo              // counted as 3 bytes (:foo)
                  //  ^ EACH characters in atom (Elixir, etc)
                  //    or characters in symbol (Ruby, etc)
                  //    are counted as 1 byte constant
''                // counted as 0 (not considered as constant)
[0xAC, 12, 114]   // counted as 3 bytes (0xAC, 12, 114)

Clarification:
things that counted as constant literal:

numbers, each byte, depends on size
strings/symbols, each character = 1 byte
chars, one byte

things that not counted as constant literal:

class declaration
function declaration
variable declaration
operators, brackets
predefined symbols
predefined constants

What about languages like Bash, where everything is equivalent to a literal (ex. echo -n hello is the same as "echo" "-n" "hello")?

echo is function calling so it's not, but -n counted as 2 bytes, hello counted as 5 bytes

The scoring rules currently just do not make sense. I think I can figure out the grammatical errors, but they require an unsupplied map between the terms you use and the tokens in a program. E.g. if I were following my best guess at the meaning of the rules, I would give your JS answer a much higher score because of all the symbols it contains (e.g. function names used other than in declarations).

I'm confused. We're supposed to print the contents of a specific file without reading any files?

I forgot to add except /etc/passwd

CJam, 49 characters + 0 bytes constant = 49
W[JCJFJIJBEIDHDHDHJBKGIJDHKCIHKFKFKJJA]Y/f+Afb:cg

It doesn't work in the online interpreter for obvious reasons.

NodeJS - 179 characters + 1 byte constant declaration = 279
#!/usr/bin/env node
fs=function fs(){};fs=require(fs.name);x=function etc(){};y=function passwd(){};z='/';fs.readFile(z+x.name+z+y.name,function(err,data){console.log(''+data);});

Readable version:
#!/usr/bin/env node
fs = function fs(){};
fs = require(fs.name);
x = function etc(){};
y = function passwd(){};
z = '/'; // 1 declaration
fs.readFile(z+x.name+z+y.name,function(err,data){
  console.log(''+data);
});


text:
Shortest Unique Substrings
Input
An alphanumeric string s.
Output
The shortest string that occurs exactly once as a (contiguous) substring in s.
Overlapping occurrences are counted as distinct.
If there are several candidates of the same length, you must output all of them in the order of occurrence.
In this challenge, the empty string occurs n + 1 times in a string of length n.
Example
Consider the string
"asdfasdfd"

The empty string occurs 10 times in it, so it is not a candidate for unique occurrence.
Each of the letters "a", "s", "d", and "f" occurs at least twice, so they are not candidates either.
The substrings "fa" and "fd" occur only once and in this order, while all other substrings of length 2 occur twice.
Thus the correct output is
["fa","fd"]

Rules
Both functions and full programs are allowed, and standard loopholes are not.
The exact formatting of the output is flexible, within reason.
In particular, producing no output for the empty string is allowable, but throwing an error is not.
The lowest byte count wins.
Test cases
"" -> [""]
"abcaa" -> ["b","c"]
"rererere" -> ["ererer"]
"asdfasdfd" -> ["fa","fd"]
"ffffhhhhfffffhhhhhfffhhh" -> ["hffff","fffff","hhhhh","hfffh"]
"asdfdfasddfdfaddsasadsasadsddsddfdsasdf" -> ["fas","fad","add","fds"]

Leaderboard
Here's the by-language leaderboard that I promised.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>site = 'meta.codegolf',postID = 5314,isAnswer = true,QUESTION_ID = 45056;jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)<\\/code><\/pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

Any limitations on combinatorial built-in functions?

@MartinBüttner In this challenge, everything goes. If this gets enough answers, I'll put up a by-language leaderboard, so even the more ill-equipped languages can have a meaningful competition.

Do you want to use my code golf leaderboard snippet? Then you wouldn't have to monitor all edits to keep the leaderboard up-to-date. If you do, I can add it for you, and I'd go through the answers to make them match the header format.

@MartinBüttner Thanks, I'd appreciate that!

All done! Let me know if something doesn't work. (Feel free to reuse it for your challenges in the future.)

You should specify target="_top" on your links. Currently, you can't change to another question since it opens inside the iframe.

You can also say the empty string occurs 0 or 1000 times in a 10-char string, are you trying to recreate ether?

@IsmaelMiguel I have to admit that I don't understand how the snippet works (it's courtesy of Matrin Büttner), so I can't fix it. But if you middle-click or Ctrl-click on the links, the answers open in new tabs, at least on Firefox. You can also just re-run the snippet to get the leaderboard back.

@lolesque The justification for the number n+1 is that I think of the substrings of a string as beginning and ending "between" the characters. For example, a suffix of length 2 begins right before the second-to-last character, and ends right after the last one. The empty substring begins and ends at the same place, and there are n+1 possible places for it.

I'm aware of that. I'm just pointing out an issue.

Shouldn't "" -> [] as "" occurs infinite times in ""?

@Reticality As I explain above, for the purposes of this challenge I define that "" occurs exactly n+1 times in a string of length n. In particular, it occurs in "" exactly once.

Pyth, 27 26 bytes
&zhfTmf!/>zhxzYYm<>zkdUzUz

Try it here.
Note that due to a bug in the online compiler, the empty string case only works correctly on the command line version, which can be found here.
You can also cure the bug by giving a newline as the input for the online compiler.
Explanation:
                                   z = input(), implicit.
&z                                 Prints empty string if input is empty.
  hfT                              Take the first non-empty list from
     m                  Uz         A list of list of substrings of z, divided by length
                m<>zkdUz           with some shorter strings repeated later, to no effect.
      f                            Where the substrings are filtered on
       !/      Y                   There being 0 occurrences of the substring in
         >z                        The slice of z
           hxzY                    from the character after the first character
                                   of the first occurrence of the substring in z
                                   to the end of z.

Fails for empty string input.

@Optimizer I think that's a bug in the online compiler, actually. It works on the command line version. In fact, z on no input fails online, so it's definitely a bug in the interpreter.

Doesn't give EOF ?

@Optimizer Pyth expects newline terminated input, which might be what is going wrong.

So passing an empty string is not even possible ?

@Optimizer If you want to test that case online, put a newline in the input field.

Python 3, 124 123 111 96 bytes
f=lambda s,n=1:[x for x in[s[i:i+n]for i in range(len(s)+1)]if s.find(x)==s.rfind(x)]or f(s,n+1)

Looks for strings such that the first occurrence from the left is the same as the first occurrence from the right. The +1 in the range is to accommodate for the empty string case.
Now if only Python had a .count() which counted overlapping matches, then this would have been a fair bit shorter.

Mathematica, 95 94 79 bytes
Cases[Tally@StringCases[#,___,Overlaps->All],{s_,1}:>s]~MinimalBy~StringLength&

StringCases gets me all possible substrings, the Tally and Cases filter out those that appear more than once and MinimalBy finds those that are shortest.

Isn't there an extra & at the end of the code?

Boy, you're fast!

GolfScript, 44 bytes
:S;-1:x{;S,x):x-),{S>x<}%:^1/{^\/,2=},.!}do`

Takes input as a string on stdin and outputs in a double-array syntax: e.g. [["b"] ["c"]]. Online demo
Dissection
:S;          # Store input in S and pop it
-1:x         # Store -1 in x
{            # do-while loop
  ;          #   Pop x the first time and [] every subsequent time
  S,x):x-),  #   Increment x and build an array [0 1 ... len(S)-x]
  {S>x<}%    #   Map that array to [substr(S,0,x) substr(S,1,x) ...]
  :^         #   Store in ^ (to avoid the token coalescing with the next char)
  1/         #   Split by length 1 to iterate over 1-elt arrays rather than strings
  {^\/,2=},  #   Filter to arrays which occur exactly once as a subarray of ^
  .!         #   Duplicate and test emptiness
}do          # end do-while loop: loop if the filtered array is empty
`            # Stringify for output

This is arranged such that no special case is required for the empty string (which I've included as a test case in the online demo linked above).

Java, 168 176 233
Here's a pretty basic nested loop example.
void n(String s){for(int l=0,i=0,t=s.length(),q=0;l++<t&q<1;i=0)for(String b;i<=t-l;)if(s.indexOf(b=s.substring(i,i+++l),s.indexOf(b)+1)<0){System.out.println(b);q++;}}

Or a bit more readable:
void t(String s){
    for(int l=0,i=0,t=s.length(),q=0;l++<t&q<1;i=0)
        for(String b;i<=t-l;)
            if(s.indexOf(b=s.substring(i,i++ +l),s.indexOf(b)+1)<0){
                System.out.println(b);
                q++;
            }
}

If you want readability, splitting +++ up to show whether it's + ++ or ++ + would help... And if you want to save a few more bytes, there might be a way to do that by initialising q=1, replacing q++ with q=t, and replacing l++<t&q<1 with something like t>l+=q. Probably requires tweaking one or two other offsets to get it to work.

@Peter Well, by readable I mostly meant "I don't have to horizontally scroll," but I clarified the +++. I've been trying to tweak it (especially q, which feels somewhat wasteful), but haven't found anything solid yet.

@PeterTaylor Due to the lexing rules of Java, +++ always resolves to ++ +.

@FUZxxl, I doubt that even most Java users know that, and there are lots of people on this site who don't know Java.

Using indexOf with offset instead of lastIndexOf should cut 1 byte (see my javascript answer)

JavaScript (ES6), 109 110
Edit search instead of indexOf, as the input string is alphanumeric. Thanks @IsmaelMiguel
Recursive function, looking for substrings starting with length 1 and going up.
F=(s,n=1,r)=>
s?[...s].map((a,i)=>~s.indexOf(a=s.substr(i,n),s.search(a)+1)?r:r=[...r||[],a])&&r||F(s,n+1):[s]

Ungolfed and explained
 F = function(s, n=1) { // start with length 1
   var i, a, p, r;
   if (s == "") // special case for empty input string
     return [s];
   for (i = 0; i < s.length; i++)
   // for each possibile substring of length n
   // (should stop at s.length-n+1 but going beyond is harmless)
   // Golfed: "[...s].map((a,i)" ... using i, a is overwrittem
   {
     a = s.substr(i, n); // substring at position i
     p = s.search(a); // p is the first position of substring found, can be i or less
     p = s.indexOf(a, p + 1) // p is now the position of a second instance of substring, or -1 if not found
     if (~p) // ~p is 0 if p is -1
     {
       ; // found more than once, do nothing
     }
     else
     {
       r = r || []; // if r is undefined, then it becomes an empty array
       r.push(a); // save substring
       // Golfed: "r=[...r||[],a]"
     }
   }
   if (r) // if found some substring, saved in r
   {
     return r;
   }
   return F(s, n+1) // recursive retry for a bigger length
 }

Test In FireFox/FireBug console

;["", "abcaa", "rererere", "asdfasdfd", "ffffhhhhfffffhhhhhfffhhh",
 "asdfdfasddfdfaddsasadsasadsddsddfdsasdf"]
.forEach(x=>console.log(x,F(x)))

Output
 [""]
abcaa ["b", "c"]
rererere ["ererer"]
asdfasdfd ["fa", "fd"]
ffffhhhhfffffhhhhhfffhhh ["hffff", "fffff", "hhhhh", "hfffh"]
asdfdfasddfdfaddsasadsasadsddsddfdsasdf ["fas", "fad", "add", "fds"]

Use .search instead of .indexOf and you save 2 bytes.

@IsmaelMiguel no because 1) search has not a offset parameter 2) search expect a regexp, and will fail with special chars like .*[] and so on

But on the first you can safely replace it (on your s.indexOf(a)+1). While it's tue it won't work with those chars, you dont have to worry! Quoting the O.P: "Input: An alphanumeric string s."

@IsmaelMiguel right, thanks. Missed the 'alphanumeric' constrain

You're welcome. Your code is shorter now, which makes it better. I'm pretty sure it can be golfed a bit. But can't see anything....

If you change your function defition from F=(s,n=1,r)=> to F=(s,n=1,r=[])=>, will it work as expected? If it does, you can remove the ||[] part ahead, shaving off another byte. I read about default parameters here: http://stackoverflow.com/questions/24197306/how-do-functions-defined-in-my-firebug-console-accept-default-parameters

@IsmaelMiguel I did not find a way ... I need truthy or falsy, and any array (even empty []) is a truthy value in javascript

I understand now. If you don't mind the bad side effects that will happen, you may use r=[];F=(s,n=1)=> s?[...s].map((a,i)=>~s.indexOf(a=s.substr(i,n),s.search(a)+1)?r:r=[...r,a])&&r||F(s,n+1):[s] instead. The side effect is that r will have all the previous results from the last time you ran the code. But it works and you shave off a byte. There is nothing in the question saying your code is meant to run n times in a row and must always return the correct result. This is rule-bending. If you want, you may add this as a note.

J, 61 58 44 42 40 38 37 bytes
[:>@{.@(#~#@>)#\<@(~.#~1=#/.~)@(]\)]

Here is a version split up into the individual components of the solution:
unqs =. ~. #~ 1 = #/.~               NB. uniques; items that appear exactly once
allsbsq =. #\ <@unqs@(]\) ]        NB. all unique subsequences
shrtsbsq =. [: >@{.@(#~ #@>) allsbsq NB. shortest unique subsequence

x #/. y computes for each distinct element in x how often in occurs in y.  If we use this as y #/. y, we get the for each distinct element in y its count. For instance, a #/. a for a =. 1 2 2 3 4 4 yields 1 2 1 2.
1 = y checks which items of y are equal to 1. For instance, 1 = a #/. a yields 1 0 1 0.
u~ is the reflexive of a monadic verb u. This is, u~ y is the same as y u y. Thus, #/.~ y is the same as #/.~ y. When applied to a dyadic verb, u~ is the passive  of u. That is, x u~ y is the same as y u x. These are used in quite a few other places which I do not explicitly mention.
~. y is the nub of y, a vector with duplicates removed. For instance, ~. a yields 1 2 3 4.
x # y (copy) selects from y the items at the indices where x contains a 1.
Thus, (1 = y #/. y) # (~. y) creates a vector of those elements of y which appear only once. In tacit notation, this verb is written as ~. #~ 1 = #/.~; let's call this phrase unqs for the rest of the explanation.
x ]\ y creates an x by 1 + y - x array of all infixes of the vector y of length x. For instance, 3 ]\ 'asdfasdfd yields
asd
sdf
dfa
fas
asd
sdf
dfd

# y is the tally of y, that is, the number of elements in y.
u\ y applies u to each prefix of y. Incidentally, #\ y creates a vector of integers from 1 to #y.
< y puts y into a box. This is needed because arrays cannot be ragged and we compute an array of suffixes of different lengths; a boxed array counts as a scalar.
Thus, (i. # y) <@:unqs@(]\) y generates a vector of #y boxed arrays of the length k (for all 0 ≤ k < #y) infixes of y that occur exactly once. The tacit form of this verb is i.@# <@unqs@(]\) ] or i.@# <@(~. #~ 1 = #/.~)@(]\) ] if we don't use the unqs name. Let's call this phrase allsbsq for the rest of this explanation. For instance, allsbsq 'asdfasdfd' yields:
┌┬─┬──┬───┬────┬─────┬──────┬───────┬────────┐
││ │fa│dfa│sdfa│asdfa│asdfas│asdfasd│asdfasdf│
││ │fd│fas│dfas│sdfas│sdfasd│sdfasdf│sdfasdfd│
││ │  │dfd│fasd│dfasd│dfasdf│dfasdfd│        │
││ │  │   │sdfd│fasdf│fasdfd│       │        │
││ │  │   │    │asdfd│      │       │        │
└┴─┴──┴───┴────┴─────┴──────┴───────┴────────┘

(#@> y) # y takes from vector of boxed arrays y those which aren't empty.
{. y takes the first element of vector y.
> y removes the box from y.
Thus, > {. (#@> y) # y yields the unboxed first non-empty array from vector of boxed arrays y. This phrase is written >@{.@(#~ #@>) in tacit notation.
Finally, [: >@{.@(#~ #@>) allsbsq assembles the previous phrase with allsbsq to create a solution to the problem we have. Here is the full phrase with spaces:
[: >@{.@(#~ #@>) i.@# <@(~. #~ 1 = #/.~)@(]\) ]

Scala, 120 bytes
readLine.inits.flatMap(_.tails).toList.groupBy(l=>l).filter(x=>x._2.length<2).map(_._1).groupBy(_.length).minBy(_._1)._2

I started off with 140 which at least already fits into a tweet.
(                                        // added for comments
 readLine                                // input
.inits.flatMap(_.tails).toList           // get all substrings of that string
.groupBy(l=>l).filter(x=>x._2.length<2)  // remove substrings that occur more than once
.map(_._1).groupBy(_.length)             // take the substring and group by length
.minBy(_._1)._2                          // take the list of shortest substrings
)

I wonder? Why doesn't just (_) work as the identity instead of l=>l?

I wonder too. Somehow list.groupBy(_) is the same as x => list.groupBy(x). I have no idea why they implemented it like that.

CJam, 52 43 40 bytes
]]q:Q,,{)Q,1$-),f{Q><}:R{R\a/,2=},}%{}=p

Input is the string without quotes
Explanation:
]]                                       "For empty string input case";
  q:Q                                    "Read the input and store in Q";
     ,,                                  "Take length of input and 0 to length array";
       {                          }%     "Map the above array on this code block";
        )Q                               "Increment the number in the current iteration, L";
         Q,1$                            "Take input's length and copy the above number";
             -)                          "Get upper limit of next loop to get substrings";
               ,f{   }                   "Get 0 to above number array and for each";
                  Q><                    "Get the L length substring at Ith index where";
                                         "I loops from 0 to Q, - L + 1";
                      :R                 "Store this list of substring of length L in R";
                        {R\a/,2=},       "Filter to get unique substrings";
                                    {}=  "Get the first non empty substring array";
                                         "This leaves nothing on stack if all are empty";
                                       p "Print the top stack element. At this point, its";
                                         "Either the first non empty substring array or";
                                         "the ]] i.e. [""] which we added initially";

Example:
asdfdfasddfdfaddsasadsasadsddsddfdsasdf

Output
["fas" "fad" "add" "fds"]

Try it online here

Haskell, 169 162 155 153 151 138 120 115
import Data.List
l=length
q k=filter$(==)k.l
p y=q(minimum.map l$y)$y
f x=p$concat$q 1$group$sort$(tails x>>=inits)

To use it:
f "asdfdfasddfdfaddsasadsasadsddsddfdsasdf"

Which gives:
["add","fad","fas","fds"]

Btw. I hate the last line of my code (repetition of h y). Anyone hints to get rid of it?

How about you define g y=q(minimum.(map l)$y)$y (are the parentheses around map l really required?) and then f=g.concat.q 1.group.sort.concatMap inits.tails?

Using >>= instead of concatMap, i.e. f x=p$concat$q 1$group$sort$(tails x>>=inits) saves 2 bytes. Why the Data.Ord import?

The parentheses in q are unnecessary, since you can write filter$(==)k.l, as are the last $ and the spaces before the ys in p. You can also remove the semicolons after the imports (Data.Ord seems indeed unnecessary).

Leksah compiler does not accept $ followed by a non-space. It will shave of some bytes, but is it in the language spec?

GHC will accept it.

PHP, 171 152 134 125
function f($s){while(!$a&&++$i<strlen($s))for($j=0;$b=substr($s,$j++,$i);)strpos($s,$b)==strrpos($s,$b)&&($a[]=$b);return$a;}

http://3v4l.org/RaWTN

You don't need to explicitly define $j=0. Ahead, you have substr($s,$j++,$i). Without defining $j, you can rewrite this to substr($s,0+$j++,$i) and you save 2 bytes. Why is that? Well, the first time, $j will be null. And you will effectively be passing null to substr, which I don't think that will work well. Using 0+$j++ will convert the null to 0. If you see that it isn't needed, go ahead without it and just remove the $j=0 part.

Tried that; it doesn't work because PHP doesn't have strong scoping, so $j is not cleared and reinitialised for each iteration of the while() loop.  So while it's null (and hence would be converted to 0 by a $j++ call) the first time around, on future iterations of the outer loop it's left at the value it was before.  It's not so much initialising as resetting.  Thanks for the suggestion though :-)

Here I offer you a 141 bytes long solution: function f($s){$l=strlen($s);while(!$a&&++$i<$l)for($j=0;$j<$l;)($b=substr($s,$j++,$i))&(strpos($s,$b)==strrpos($s,$b)&&($a[]=$b));return$a;} Changes: Removed ALL your ||1, used the bitwise & (AND) instead of && in one place, moved the $j<$l&&[...] part outside the for (saving 2 bytes) and removed some unnecessary parenthesys.

One 134 bytes long gift for you: function f($s){$l=strlen($s);while(!$a&&++$i<$l)for($j=0;$j<$l;)strpos($s,$b=substr($s,$j++,$i))==strrpos($s,$b)&&($a[]=$b);return$a;} Changes made to the previous code: moved the $b=substr($s,$j++,$i) into strpos($s,$b) making it strpos($s,$b=substr($s,$j++,$i)), removed more unecessary parenthesys and removed the unneeded &.

I think it will be hard to reduce the size further. You can leave the old solution to show what you had and what you have now.

Managed a little more chopping :-)  substr($s,$j++,$i) returns "" when $j reaches the length of the string, and false thereafter, so that assignment can also serve as the loop conditional break.  Then there's only one use of $l remaining, so that can be consolidated as well.

Nice one! Now, lets bend rules! Since the rules say that Both functions and full programs are allowed, and standard loopholes are not., you can remove the whole function f($s){ part. Then you use this: while(!$a&&++$i<strlen($s=$_GET[s]))for($j=0;$b=substr($s,$j++,$i);)strpos($s,$b)==strrpos($s,$b)&&($a[]=$b);print_r($a); which is 121 bytes long now. You have to explain that it is required to send a URL parameter named s with the string while accessing the file over the browser. Example: a.php?s=YourStringHere. It will throw warnings but the O.P. didn't said they weren't allowed!

Instead of $_GET[s] you can use $argv[1] which receives the string though standard input. You may need more testing, but both solutions should work fine.

If I did that, I would need to change the return $a statement to a print_r($a), which would use up all bar one of the bytes saved.  Can't return an array either from a shell script or web request.

If you notice the code I provided you, it already has the print_r there.

Haskell, 135 Bytes
import Data.List
f ""=[""]
f g=map(snd)$head$groupBy(\a b->fst a==fst b)$sort[(length y,y)|[y]<-group$sort[x|x@(_:_)<-tails g>>=inits]]

Rebol, 136 bytes
f: func[s][repeat n length? b: copy s[unless empty? x: collect[forall s[unless find next find b t: copy/part s n t[keep t]]][return x]]]

Ungolfed:
f: func [s] [
    repeat n length? b: copy s [
        unless empty? x: collect [
            forall s [
                unless find next find b t: copy/part s n t [keep t]
            ]
        ][return x]
    ]
]

Usage example:
>> f ""
== none

>> f "abcaa"
== ["b" "c"]

>> f "rererere"
== ["ererer"]

>> f "asdfasdfd"
== ["fa" "fd"]

>> f "ffffhhhhfffffhhhhhfffhhh"
== ["hffff" "fffff" "hhhhh" "hfffh"]

>> f "asdfdfasddfdfaddsasadsasadsddsddfdsasdf"
== ["fas" "fad" "add" "fds"]

NB. I suppose the heart of the code is how the find part is working.  Hopefully this will help explain...
>> find "asdfasdfd" "df"
== "dfasdfd"

>> next find "asdfasdfd" "df"
== "fasdfd"

>> find next find "asdfasdfd" "df" "df"
== "dfd"

>> ;; so above shows that "df" is present more than once - so not unique
>> ;; whereas below returns NONE because "fa" found only once - ie. bingo!

>> find next find "asdfasdfd" "fa" "fa"
== none

Groovy (Java regex on Oracle implementation), 124
c={m=it=~/(?=(.*?)(?=(.*))(?<=^(?!.*\1(?!\2$)).*))/;o=m.collect({it[1]});o.findAll({it.size()==o.min({it.size()}).size()});}

Tested on Groovy 2.4 + Oracle JRE 1.7. The regex should work for Java 6 to Java 8, since the bug that allows the code above to work is not fixed. Not sure for previous version, since there is a look-behind bug in Java 5 which was fixed in Java 6.
The regex finds the shortest string which doesn't have a duplicate substring elsewhere, at every position in the input string. The code outside takes care of filtering.
(?=(.*?)(?=(.*))(?<=^(?!.*\1(?!\2$)).*))

Since the strings can overlap, I surround the whole thing in look-ahead (?=...).
(.*?) searches from the shortest substring
(?=(.*)) captures the rest of the string to mark the current position.
(?<=^(?!.*\1(?!\2$)).*) is an emulation of variable-length look-behind, which takes advantage of the implementation bug which allows (?<=.*) to pass the length check.
(?!.*\1(?!\2$)) simply checks that you can't find the same substring elsewhere. The (?!\2$) rejects the original position where the substring is matched.
The limit of the outer look-around construct doesn't apply to the nested look-around construct. Therefore, the nested negative look-ahead (?!.*\1(?!\2$)) actually checks for the whole string, not just up to the right boundary of the look-behind.

Haskell, 119
f s=[r|n<-[1..length s],l<-[map(take n)$take(length s-n+1)$iterate(drop 1)s],r<-[[j|j<-l,[j]==[r|r<-l,r==j]]],r/=[]]!!0

you can put q = length somewhere and use q, shaves off some bytes

Brachylog, 10 bytes
sᶠ≡ᵍ~gˢlᵍt

Try it online!
sᶠ            The list of every substring of the input
  ≡ᵍ          grouped by identity,
    ~gˢ       with length-1 groups converted to their elements and other groups discarded,
       lᵍ     and grouped by their length,
         t    has the output as its last group.

Although ᵍ doesn't naturally sort by the value it groups by, instead ordering the groups by the first occurrence of each value, the first occurrences of every length are in decreasing order. I'm not 100% sure that the uniqueness filtering can't mess this up, but I haven't come up with a test case this fails yet.

05AB1E, 10 bytes
Œʒ¢}é.γg}н

Outputs nothing for an empty string.
Try it online or verify all test cases.
Explanation:
Œ           # Get all substrings of the (implicit) input-String
 ʒ          # Filter it by:
  ¢         #  Count how many times the current substring occurs in the (implicit) input-String
            #  (only 1 is truthy in 05AB1E, so the filter will leave unique substrings)
   }é       # After the filter: sort the remaining substrings by length
     .γg}   # Then group them by length as well
         н  # And only leave the first group containing the shortest substrings
            # (which is output implicitly as result)

This takes advantage of 05AB1E's only having 1 as truthy value, and everything else as falsey. The shortest unique substring is always guaranteed to occur exactly once for all possible input-strings. (For an input-string containing only the same characters (i.e. aaaaa), the input-strings itself as substring occurs just once, so the result is ["aaaaa"]. For an input-String with repeating pattern (i.e. "abcabc"), there are still unique substrings that only occur once (["abca","abcab","abcabc","bca","bcab","bcabc","ca","cab","cabc"]), so this will result in ["ca"].)

Python 2, 150
import re
a=input()
r=range
l=len(a)
d=0
for i in r(l):
 if d:break
 for j in r(l-i):
  k=a[j:i+j+1]
  if len(re.findall("(?="+k+")",a))<2:d=1;print k

Gray area, it should print "", but you print nothing.

@Jakube "The exact formatting of the output is flexible"

But you have no output at all.

@Jakube The output is the empty string, just like it's supposed to be. I just don't have quotes around it.

Well, I don't think so. print("") and doing nothing causes different results. The first one prints an empty line. But I don't wanna argue. Probably fine.

@Jakube I'll allow this, since the empty string is a special case anyway.

Perl 5 -a, 114 87 bytes
map{//;(grep$' eq$_,@q)-1||($l||=y///c)-y///c||say}@q=map{"@F"=~/(?=(.{$_}))/g}1..y///c

Try it online!
Old method:
114 bytes