text:
Run Length Decoding
Write the shortest code in the language of your choice to perform run length decoding of the given string.
The string will be supplied as input on stdin in the form
CNCNCNCNCNCNCNCN

where each C could be any printable ASCII character and each N is a digit 1 to 9 (inclusive).
Sample input:
:144,1'1

Corresponding output:
:4444,'

Brainfuck, 34 characters
,[>,>++++++[<-------->-]<[<.>-]<,]

Wow. A brainfuck solution that can compete with other solutions?

Shakespeare Programming Language, 406 bytes
.
Ajax,.
Ford,.
Act I:.
Scene I:.
[Enter Ajax and Ford]
Scene II:.
Ford:
Open your mind.Is sky nicer than you?If so, let us return to scene IV.
Ajax:
Open your mind.You is sum you and sum big big big big big big pig and big big big big cat!
Scene III:.
Ford:
Speak thy mind.
Ajax:
You is sum you and pig!Is you as big as zero?If so, let us return to scene II.Let us return to scene III.
Scene IV:.
[Exeunt]

Ungolfed version:
The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]

I'm using drsam94's Python SPL compiler, which has a few bugs (which is why, for instance, I use Open your mind instead of Open thy mind in the golfed version).
To run this program, use:
$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'

How it works
SPL is an esoteric programming language designed to make programs look like Shakespeare plays. It does this by using characters as variables, and processing is performed by having the characters say things to one another.
The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

This is the title of the play; it's ignored by the compiler.
Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Here we're declaring the variables used in the rest of the program. Everything betwen , and . is ignored by the compiler. In this case, we declare Romeo, used to hold the character being decoded, and Juliet, used to hold the run length of the character.
Act I: In which the lengths of runs are decoded.

Here we declare the first and only act in the program. Acts and scenes are like labels; they can be jumped to at any time by using let us return to scene II or some variant of that. We only use one act, because it's sufficient for our needs. Again, anything between : and . is ignored by the compiler.
Scene I: A silent entrance.

Here we declare the first scene. Scenes are numbered in Roman numerals: the first is Scene I, the second Scene II, and so on.
[Enter Romeo and Juliet]

This is a stage direction; in it, we tell the Romeo and Juliet variables to come onto the "stage". Only two variables can be on the "stage" at once; the stage is used so that the compiler can figure out which variable is addressing which when they speak. Because we have only two variables, Romeo and Juliet will stay onstage for the length of the program.
Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Another scene declaration. Scene II will be jumped to in order to decode another run-length.
Juliet:

This form of declaration means that Juliet is going to start speaking. Everything until the next Romeo:, stage direction, or scene/act declaration will be a line spoken by Juliet, and thus "me" will refer to Juliet, "you"/"thou" to Romeo, etc.
Open your mind.

This command stores the ordinal value of single character from STDIN in Romeo.
Is my mother jollier than thou?

In SPL, nouns translate to either 1 or -1 depending on whether they are positive or negative. In this case, my mother translates to 1. Adjectives (positive or negative) multiply their noun by 2.
This is a question; in it, Juliet asks if my mother (AKA 1) is "jollier" than Romeo. Comparatives either translate to less than (if they are negative, like worse) or greater than (if they are positive, like jollier). Therefore, this question boils down to Is 1 greater than you?.
The reason we ask this question is to detect the end of the input. Since the value of EOF varies by platform, but is usually less than 1, we use this to detect it.
If so, we must proceed to scene IV.

If the preceding question evaluated to true, we jump to scene IV—which is simply the end of the program. In short, if we detect an EOF, we end the program.
Romeo:

It's now Romeo's line: "me" and "you" refer to Romeo and Juliet, respectively.
Open your mind.

Again, this statement puts the ordinal value of a single character from STDIN into Juliet, which in this case is the run-length of the character stored in Romeo.
Thou art the sum of thyself and the sum of my good aunt and the difference
between nothing and the quotient of the square of twice the sum of thy foul
fat-kidneyed goat and thy death and thy evil variable!

This one's too long to go over in great detail, but just trust me in that it translates to Juliet -= 48. We do this because Juliet holds the ASCII value of a numeral, and ord('0') == 48; in subtracting 48, we translate from the ASCII value of a number to the number itself.
Scene III: In which Romeo snaps and brutally insults Juliet.

Another scene declaration. This one is for the loop in which we repeatedly print the character value of Romeo, Juliet times.
Juliet:
  Speak thy mind.

This statement causes Romeo to print his value as a character; that is, whatever character value was previously stored in Romeo is now output.
Romeo:
  Thou art the sum of thyself and a hog!

A hog is a negative noun, so a hog translates to -1; therefore, this statement evaluates to Juliet -= 1.
Art thou as rotten as nothing?

Romeo here asks if Juliet is "as rotten as", or equal to, 0.
If so, let us return to scene II.

If Juliet's value is 0, we loop back to scene II to decode another character's run-length.
Let us return to scene III.

Else, we loop back to scene III to output Romeo's character again.
Scene IV: Finale.

[Exeunt]

This final scene declaration is just a marker for the end of the program. The [Exeunt] stage direction is necessary to get the compiler to actually generate the final scene.

GolfScript, 10 characters
2/{1/~~*}/

perl, 27 characters
print<>=~s/(.)(.)/$1x$2/ger

This seems unnecessarily verbose: print<>=~s/(.)(.)/$1x$2/ger. I'm also fairly sure you meant $1x$2, and not the other way around.

@primo true - I didn't know about the r flag and I couldn't find it. Thanks. As for other part - sorry, I misread the spec. I'll edit when I can.

BTW /r is documented in perlop and was added in v5.14.0

Using the -p flag let you drop print and <>, so answer will become simply: s/(.)(.)/$1x$2/ge -> 17chars +1 for -p -> 18.

Python 3, 52
Python 3 allows me to merge the approaches of my two python2 solutions.
s=input()
t=''
while s:a,b,*s=s;t+=a*int(b)
print(t)

Python 2 raw_input matches Python 3 input. So first line must by s=input()

49: s=input() while s:a,b,*s=s;print(a*int(b),end='')

46 bytes

R 67
x=strsplit(readline(),"")[[1]];cat(rep(x[c(T,F)],x[c(F,T)]),sep="")

+1 I had no idea rep would coerce the times argument from characters to integers automatically. Brilliant.

Malbolge Unshackled (20-trit rotation variant), 4,494e6 bytes
Size of this answer exceeds maximum postable program size (eh), so the code is located in my GitHub repository.
How to run this?
This might be a tricky part, because naive Haskell interpreter will take ages upon ages to run this. TIO has decent Malbogle Unshackled interpreter, but sadly I won't be able to use it (limitations).
The best one I could find is the fixed 20-trit rotation width variant, that performs very well, decompressing 360 bytes per hour.
To make the interpreter a bit faster, I've removed all the checks from Matthias Lutter's Malbolge Unshackled interpreter.
My modified version can run around 6,3% faster.
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

const char* translation = "5z]&gqtyfr$(we4{WP)H-Zn,[%\\3dL+Q;>U!pJS72Fh"
        "OA1CB6v^=I_0/8|jsb9m<.TVac`uY*MK'X~xDl}REokN:#?G\"i@";

typedef struct Word {
    unsigned int area;
    unsigned int high;
    unsigned int low;
} Word;

void word2string(Word w, char* s, int min_length) {
    if (!s) return;
    if (min_length < 1) min_length = 1;
    if (min_length > 20) min_length = 20;
    s[0] = (w.area%3) + '0';
    s[1] = 't';
    char tmp[20];
    int i;
    for (i=0;i<10;i++) {
        tmp[19-i] = (w.low % 3) + '0';
        w.low /= 3;
    }
    for (i=0;i<10;i++) {
        tmp[9-i] = (w.high % 3) + '0';
        w.high /= 3;
    }
    i = 0;
    while (tmp[i] == s[0] && i < 20 - min_length) i++;
    int j = 2;
    while (i < 20) {
        s[j] = tmp[i];
        i++;
        j++;
    }
    s[j] = 0;
}

unsigned int crazy_low(unsigned int a, unsigned int d){
    unsigned int crz[] = {1,0,0,1,0,2,2,2,1};
    int position = 0;
    unsigned int output = 0;
    while (position < 10){
        unsigned int i = a%3;
        unsigned int j = d%3;
        unsigned int out = crz[i+3*j];
        unsigned int multiple = 1;
        int k;
        for (k=0;k<position;k++)
            multiple *= 3;
        output += multiple*out;
        a /= 3;
        d /= 3;
        position++;
    }
    return output;
}

Word zero() {
    Word result = {0, 0, 0};
    return result;
}

Word increment(Word d) {
    d.low++;
    if (d.low >= 59049) {
        d.low = 0;
        d.high++;
        if (d.high >= 59049) {
            fprintf(stderr,"error: overflow\n");
            exit(1);
        }
    }
    return d;
}

Word decrement(Word d) {
    if (d.low == 0) {
        d.low = 59048;
        d.high--;
    }else{
        d.low--;
    }
    return d;
}

Word crazy(Word a, Word d){
    Word output;
    unsigned int crz[] = {1,0,0,1,0,2,2,2,1};
    output.area = crz[a.area+3*d.area];
    output.high = crazy_low(a.high, d.high);
    output.low = crazy_low(a.low, d.low);
    return output;
}

Word rotate_r(Word d){
    unsigned int carry_h = d.high%3;
    unsigned int carry_l = d.low%3;
    d.high = 19683 * carry_l + d.high / 3;
    d.low = 19683 * carry_h + d.low / 3;
    return d;
}

// last_initialized: if set, use to fill newly generated memory with preinitial values...
Word* ptr_to(Word** mem[], Word d, unsigned int last_initialized) {
    if ((mem[d.area])[d.high]) {
        return &(((mem[d.area])[d.high])[d.low]);
    }
    (mem[d.area])[d.high] = (Word*)malloc(59049 * sizeof(Word));
    if (!(mem[d.area])[d.high]) {
        fprintf(stderr,"error: out of memory.\n");
        exit(1);
    }
    if (last_initialized) {
        Word repitition[6];
        repitition[(last_initialized-1) % 6] =
                ((mem[0])[(last_initialized-1) / 59049])
                    [(last_initialized-1) % 59049];
        repitition[(last_initialized) % 6] =
                ((mem[0])[last_initialized / 59049])
                    [last_initialized % 59049];
        unsigned int i;
        for (i=0;i<6;i++) {
            repitition[(last_initialized+1+i) % 6] =
                    crazy(repitition[(last_initialized+i) % 6],
                        repitition[(last_initialized-1+i) % 6]);
        }
        unsigned int offset = (59049*d.high) % 6;
        i = 0;
        while (1){
            ((mem[d.area])[d.high])[i] = repitition[(i+offset)%6];
            if (i == 59048) {
                break;
            }
            i++;
        }
    }
    return &(((mem[d.area])[d.high])[d.low]);
}

unsigned int get_instruction(Word** mem[], Word c,
        unsigned int last_initialized,
        int ignore_invalid) {
    Word* instr = ptr_to(mem, c, last_initialized);
    unsigned int instruction = instr->low;
    instruction = (instruction+c.low + 59049 * c.high
            + (c.area==1?52:(c.area==2?10:0)))%94;
    return instruction;
}

int main(int argc, char* argv[]) {
    Word** memory[3];
    int i,j;
    for (i=0; i<3; i++) {
        memory[i] = (Word**)malloc(59049 * sizeof(Word*));
        if (!memory) {
            fprintf(stderr,"not enough memory.\n");
            return 1;
        }
        for (j=0; j<59049; j++) {
            (memory[i])[j] = 0;
        }
    }
    Word a, c, d;
    unsigned int result;
    FILE* file;
    if (argc < 2) {
        // read program code from STDIN
        file = stdin;
    }else{
        file = fopen(argv[1],"rb");
    }
    if (file == NULL) {
        fprintf(stderr, "File not found: %s\n",argv[1]);
        return 1;
    }
    a = zero();
    c = zero();
    d = zero();
    result = 0;
    while (!feof(file)){
        unsigned int instr;
        Word* cell = ptr_to(memory, d, 0);
        (*cell) = zero();
        result = fread(&cell->low,1,1,file);
        if (result > 1)
            return 1;
        if (result == 0 || cell->low == 0x1a || cell->low == 0x04)
            break;
        instr = (cell->low + d.low + 59049*d.high)%94;
        if (cell->low == ' ' || cell->low == '\t' || cell->low == '\r'
                || cell->low == '\n');
        else if (cell->low >= 33 && cell->low < 127 &&
                (instr == 4 || instr == 5 || instr == 23 || instr == 39
                    || instr == 40 || instr == 62 || instr == 68
                    || instr == 81)) {
            d = increment(d);
        }
    }
    if (file != stdin) {
        fclose(file);
    }
    unsigned int last_initialized = 0;
    while (1){
        *ptr_to(memory, d, 0) = crazy(*ptr_to(memory, decrement(d), 0),
                *ptr_to(memory, decrement(decrement(d)), 0));
        last_initialized = d.low + 59049*d.high;
        if (d.low == 59048) {
            break;
        }
        d = increment(d);
    }
    d = zero();

    unsigned int step = 0;
    while (1) {
        unsigned int instruction = get_instruction(memory, c,
                last_initialized, 0);
        step++;
        switch (instruction){
            case 4:
                c = *ptr_to(memory,d,last_initialized);
                break;
            case 5:
                if (!a.area) {
                    printf("%c",(char)(a.low + 59049*a.high));
                }else if (a.area == 2 && a.low == 59047
                        && a.high == 59048) {
                    printf("\n");
                }
                break;
            case 23:
                a = zero();
                a.low = getchar();
                if (a.low == EOF) {
                    a.low = 59048;
                    a.high = 59048;
                    a.area = 2;
                }else if (a.low == '\n'){
                    a.low = 59047;
                    a.high = 59048;
                    a.area = 2;
                }
                break;
            case 39:
                a = (*ptr_to(memory,d,last_initialized)
                        = rotate_r(*ptr_to(memory,d,last_initialized)));
                break;
            case 40:
                d = *ptr_to(memory,d,last_initialized);
                break;
            case 62:
                a = (*ptr_to(memory,d,last_initialized)
                        = crazy(a, *ptr_to(memory,d,last_initialized)));
                break;
            case 81:
                return 0;
            case 68:
            default:
                break;
        }

        Word* mem_c = ptr_to(memory, c, last_initialized);
        mem_c->low = translation[mem_c->low - 33];

        c = increment(c);
        d = increment(d);
    }
    return 0;
}

It's working!

APL (22)
,/{⍺/⍨⍎⍵}/↑T⊂⍨~⎕D∊⍨T←⍞

Explanation:

T←⍞: store input in T
T⊂⍨~⎕D∊⍨T: split T on those characters that aren't digits
↑: turn it into a 2-by-N/2 matrix
{⍺/⍨⍎⍵}/: on each row of the matrix (/), replicate (/) the first character (⍺) by the eval (⍎) of the second character (⍵)
,/: concatenate the output of each row

Ruby, 30 bytes
gsub!(/(.)(.)/){$1*$2.to_i}

27 bytes code + 3 bytes to run it with the -p flag:
$ ruby -p rld.rb <<< ":144,1'1"
:4444,'

8086 assembly, 106 98 characters
l:
mov ah,8
int 21h
mov bl,al
int 21h
sub al,48
mov cl,al
xor ch,ch
mov al,bl
mov ah,14
p:
int 10h
loop p
jmp l

If the numbers were before the characters in the input stream, two lines (18 characters) could be shaved off of this.

Just removed a redundant "mov ah,8"

You should post compiled byte count rather than our assembler char count. Rules abuse FTW

What about dq 21cdc38821cd08b4 d888ed30c188482c e8ebfce210cd14b4 for 53 characters?  I don't see where it handles non-uppercase characters or eof though...

arrdem: Good idea. I wonder if it's even breaking the rules if I hand-assemble it in a hex editor. I'd still be directly writing the code, just on a lower level than asm source. :)
Jason: I don't see anything about EOF in the rules. It's stdin, just hit ctrl-c to stop it. Also why wouldn't it handle lowercase letters?

Generally machine code is counted by byte count in comparison to source code count for interpreted or compiled languages, as there really is no reasonable alternative.

I count your code as 24 bytes assembled. You can -2 bytes by using push ax instead of mov bl,al and pop ax instead of mov al,bl. Also you can -2 more by removing the xor ch,ch since CH is init'd to 0 by DOS (http://www.fysnet.net/yourhelp.htm).

GNU SED, 122 + 2 (-r)
#n
s/.*/\n&\a987654321\v\v\v\v\v\v\v\v\v/
:a
s/\n(.)(.)(.*\a.*\2.{9}(.*))/\1\n\4\3/
tb
bc
:b
s/(.)\n\v/\1\1\n/
tb
ba
:c
P

Needs to be run with the -r flag
May be reduced to 110 + 2 by replacing \v with the unprintable 0x0B and \a with 0x07

+1 (\2.{9} is a great idea) splendid!

C, 65 chars
Gets the input as a parameter.
main(p,v)char*p,**v;{
    for(p=v[1];*p;--p[1]<49?p+=2:0)putchar(*p);
}

I can't get past this with gcc:  error: first parameter of 'main' (argument count) must be of type 'int'.  Is there a command line switch?

@DarrenStone, this code isn't 100% standard compliant. I don't use the first parameter as a parameter, so its type doesn't matter. Most compilers don't mind so much.

Ok, thanks. I'm envious of your golf-friendlier compiler! :)

Perl, 19 18 characters
perl -pe 's/(.)(.)/$1x$2/ge'

The rules for counting switches on the command-line are here.

Haskell, 58 56 characters
f[]=[]
f(x:y:s)=replicate(read[y])x++f s
main=interact$f

My first real attempt at golfing anything, so there's probably some improvement to be made here.

read[y] saves two characters

@MtnViewMark Thanks. I put it in.

I'm getting 57 bytes for this? You can replace replicate x y with [1..x]>>[y]. Thus your second line can be replaced with f(x:y:s)=(['1'..y]>>[x])++f s, which brings it down to 53 bytes.

Forth, 45 characters
BEGIN KEY KEY 48 - 0 DO DUP EMIT LOOP 0 UNTIL

Tested with pforth on OS X.

C, 68 characters
@ugoren's answer in C is slightly shorter, but this answer complies with the requirement that "the string will be supplied as input on stdin."
n;main(c){for(;;){c=getchar(),n=getchar()-48;while(n--)putchar(c);}}

You can shave off a character by dropping "int " and declaring c and n as parameters of main, another by using for(;;) instead of while(1), and finally two more by dropping the braces on the innermost while loop.

Thanks, @Stuntddude! I applied the loop and brace suggestions, but I'm struggling with "declaring c and n as parameters of main".  Still, this shaved 3 chars. Cheers.

Since main() is a function, you can give it parameters, like: main(c,n){ ... } which will be passed 1 by default when the program is run.

Thanks @Stuntddude. I'm aware of that and can take advantage of the 1st int arg, but compiler(s) I use complain error: second parameter of 'main' (argument array) must be of type 'char **' so I can't get away with main(c,n); I must use main(int c,char **n). Could be a platform or gcc thing.

My compiler lets me do n;main(c) but not main(n,c) -- good enough! :)

Python, 63 62 characters
print''.join([c*int(n)for c,n in zip(*[iter(raw_input())]*2)])

Nice trick with iter there... I think I'll use it myself!

Windows PowerShell, 55 chars
-join((read-host)-split'(..)'|%{(""+$_[0])*(""+$_[1])})

I get the feeling that this can be golfed down more, specifically with the casts from char to string and int, but I don't have the time to keep working on it right now.

05AB1E, 6 5 bytes
2ι`ÅΓ

-1 byte thanks to @Grimy.
Outputs as a list of characters.
Try it online.
Old 6 bytes answer without run-length decode builtin:
2ôε`×?

Try it online.
Explanation:
2ι      # Uninterleave the (implicit) input-string in two parts
        #  i.e. ":144,1'3" → [":4,'","1413"]
  `     # Push both separated to the stack
   ÅΓ   # Run-length decode
        #  i.e. ":4,'" and "1413" → [":","4","4","4","4",",","'","'","'"]
        # (after which the result is output implicitly)

2ô      # Split the (implicit) input-string into parts of size 2
        #  i.e. ":144,1'3" → [":1","44",",1","'3"]
  ε     # Loop over each of these pairs:
   `    #  Push both characters separated to the stack
    ×   #  Repeat the first character the digit amount of times as string
        #   i.e. "'" and "3" → "'''"
     ?  #  And print it without trailing newline

2ι`ÅΓ is 5 bytes. Would be sad if the RLE built-in didn't win an RLE challenge.

@Grimy Ah, that's indeed better, thanks! :)

Japt -P, 8 bytes
Input as an array of characters, output as a string.
ò crÈpY°

Try it
ò crÈpYn     :Implicit input of character array
ò            :Groups of 2
   r         :Reduce each pair
    È        :By passing them through the following function as [X,Y]
     p       :  Repeat X
      Yn     :    Y, converted to an integer, times
             :Implicitly join and output

Oh, creepy!

@Khuldraesethna'Barya, it can also be ò crÏ°îX if you find it too creepy!

Thunno 2 J, 4 bytes
d^N×

Try it online!
Explanation
d^N×  # Implicit input      ->  ":144,1'1"
d     # Cast to characters  ->  [":","1","4","4",",","1","'","1"]
 ^    # Uninterleave        ->  [":","4",",","'"]  ["1","4","1","1"]
  N   # Cast to integer     ->  [":","4",",","'"]  [1,4,1,1]
   ×  # Multiply together   ->  [":","4444",",","'"]
      # Implicit output     ->  :4444,'

Python, 78 72 66 char

d=raw_input()
print"".join([x*int(d[i+1])for i,x in enumerate(d)if~i&1])

s=raw_input()
print"".join(i*int(j)for i,j in zip(s[::2],s[1::2]))

GolfScript (10 chars)
2/{)15&*}/

J - 24
;@(_2(<@#~".)/\])@1!:1 3

The point of this submission is to use the infix adverb.

Python 2, 58
This is inspired by Darren Stone's python solution -- iterator abuse!
x=iter(raw_input())
print''.join(a*int(next(x))for a in x)

This is my original solution (60 chars)
s=raw_input()
t=''
while s:t+=s[0]*int(s[1]);s=s[2:]
print t

A different approach is 3 chars longer:
f=lambda a,b,*x:a*int(b)+(x and f(*x)or'')
print f(raw_input())

Befunge, 49 chars
>~:25*-      v
$>\1-:v:-*68~_@
$^ ,:\_v
^      <

K, 35
{,/(#).'|:'"*I"$/:(2*!-_-(#x)%2)_x}

,/{(. y)#x}.'0N 2# for 18 bytes.

Java: 285 charas
import java.util.Scanner;public class A{public static void main(String args[]){Scanner s = new Scanner(System.in);while(s.hasNext()){String t=s.next();for(int i=0;i<t.length();i++) {for(int j=0; j<(Byte.valueOf(t.substring(i+1,i+2)));j++){System.out.print(t.substring(i,i+1));}i++;}}}}

Use static blocks instead of a main, and compile it with Java6!

Befunge-98, 22 chars
>#@~~"0"-v
^#:\,:\-1<_

Whitespace, 135
LSSSLSSSSLSLSTLTSTTTSLSSSSTSSSSLTSSTLTTTTLSSSSLSLSTLTSTTTSSSTTSSSSLTSSTLSSSSLSLSLTSTLSSSTLTSSTSTSSTLTLSSLSLSSLLSSTLSLLSLLLSLSLLSSTTLLLL

(Replace S,T,L with Space,Tab,Linefeed characters.)
Try it online [here].
Explanation:
"assembly"      whitespace                                      stack
----------      ----------                                      -----
s:              LSS SL      ;input loop                         []
    push 0      SS SSL                                          [0]
    dup         SLS                                             [0,0]
    getc        TLTS        ;input & store char c               [0]
    rcl         TTT         ;recall c                           [c]
    dup         SLS                                             [c,c]
    push 16     SS STSSSSL                                      [c,c,16]
    sub         TSST                                            [c,c-16]
    jlt  tt     LTT TTL     ;exit if ord(c) < 16                [c]
    push 0      SS SSL                                          [c,0]
    dup         SLS                                             [c,0,0]
    getc        TLTS        ;input & store char n               [c,0]
    rcl         TTT         ;recall n                           [c,n]
    push 48     SS STTSSSSL ;convert n to m = ord(n)-ord('0')   [c,n,48]
    sub         TSST                                            [c,m]

ss:             LSS SSL     ;inner loop outputs c, m times      [c,m]
    dup         SLS                                             [c,m,m]
    jeq  t      LTS TL      ;if m==0, stop outputting this c    [c,m]
    push 1      SS STL      ;otherwise decr m                   [c,m,1]
    sub         TSST                                            [c,m-1]
    copy 1      STS STL     ;copy c to tos                      [c,m-1,c]
    putc        TLSS        ;output this c                      [c,m-1]
    jmp  ss     LSL SSL     ;loop back to output this c again   [c,m-1]

t:              LSS TL                                          [c,m]
    pop         SLL                                             [c]
    pop         SLL                                             []
    jmp  s      LSL SL      ;loop back to get the next c,n      []

tt:             LSS TTL                                         [c]
    end         LLL         ;exit

Clojure (107)
(pr(apply str(map #(apply str(repeat(Integer/parseInt(str(second %)))(first %)))(partition 2(read-line)))))

This feels exceptionally long for being Clojure, if someone can do better, please post it.

60 or 73 bytes at https://codegolf.stackexchange.com/a/188823/59617 ;)

C# - 108 105 bytes
void f(){var s=Console.ReadLine();for(int i=0;i<s.Length;i+=2)Console.Write(new string(s[i],s[i+1]-48));}

Explanation:
void f()
{
    var s = Console.ReadLine(); // Read the input from STDIN.

    // Loop until the end of the string, and increment our index counter by 2 at each iteration.
    for (int i = 0; i < s.Length; i += 2)

        Console.Write(new string(s[i], s[i + 1] - 48)); // Create (s[i + 1] - 48) copies of the current character, and print it.
        // s[i + 1] - 48 implicitly casts the character at s[i + 1] to its integer digit form.
}

Please add an explanation to help people less familiar with C# although it may seem simple enough, short answers with no code do get auto-flagged

@RohanJhunjhunwala Sure. I'll add it when I get home. My C++ answer will also have it then.

@RohanJhunjhunwala Explanation added. Does it look good to you?

Looks good, good work!

JavaScript (ES6), 40 bytes
s=>s.replace(/../g,v=>v[0].repeat(v[1]))

f=
  s=>s.replace(/../g,v=>v[0].repeat(v[1]))
;
console.log(f(":144,1'1"))

PHP, 51 bytes
for(;--$z?:($c=$argn[$i++]).$z=$argn[$i++];)echo$c;

Try it online!
PHP, 54 bytes
for(;~$c=$argn[$i++];)echo str_repeat($c,$argn[$i++]);

Try it online!
PHP, 54 bytes
for(;~$c=$argn[$i++];)echo str_pad($c,$argn[$i++],$c);

Try it online!

RProgN, 55 Bytes
S y = '' x = y L ¿ y pop y pop \ rep x . 'x' = y L } x

Explained
S y =               # Convert the input to a backwards stack, assign it to y.
'' x =              # Assign a blank string to x
y L                 # Push the length of y
¿                   # While the top of the stack is truthy, popping.
    y pop           # Push the top value of y to the stack.
    y pop           # Twice.
    \               # Swap them around, so we get C 1 instead of 1 C
    rep             # Repeat the string. (C 1 times in the above example)
    x . 'x' =       # Append it to the back of x, and re-assign it. We use the back because we're starting at the END of the string.
    y L             # Push the length of y for the next itteration of the loop.
}                   #
x                   # Push x, and implicitly print it.

Try it Online!

Jelly, 10 bytes
s2µṪV$€x@Ẏ

Try it online!
GOLFSCRIPT TIE JELLY DAT IMPOSSIBLE WAAAAAT!?
Jelly, 10 bytes
Ḋm2V€x@m2$

Try it online!

Brachylog, 11 bytes
ġ₂{ẹịᵗj₎}ᵐc

Try it online!
          c    The output is the concatenation of
  {     }ᵐ     the result of mapping
   ẹịᵗj₎       repeating the first element by the second converted to an integer
ġ₂             over the length-2 chunks of the input.

K (oK), 17 bytes
Solution:
,/{(.y)#x}.'0N 2#

Try it online!
Explanation:
,/{(.y)#x}.'0N 2# / the solution
            0N 2# / reshape input into Nx2 grid
  {      }.'      / apply lambda to each pair of inputs
       #x         / take from x
   (  )           / do this together
    .y            / value y (ie "5" => 5)
,/                / flatten

><>, 28 24 bytes
Saved 4 bytes thanks to Jo King!
/1-:?v
\$o:$<-*c4i;?(0:i

Try it online!
This was very interesting to golf the form. You can see my process below.
Alternatives
i:0(?;i4c*->:    ?v
           ^$o:$-1<

/?      <:-*c4i;?(0:i
\1-$:o$:^0

/?    :<-*c4i;?(0:i
\1-$:o$^.00

/?    :<-*c4ip1c;?(0:i
\1-c1go^.00

/?    :<-*c4ip1c;?(0:i
\1-c1go^.00

/?}-1<:-*c4i;?(0:i[0
\:o}:^.00

/?}-1<:-*c4i;?(0:i[0
\:o}:^00

0/?}-1<:-*c4i;?(0:i[
0\:o}:^

Perl 6, 20 bytes
{S:g{(.)(.)}=$0 x$1}

Try it online!
Anonymous codeblock containing a regex that replaces each pair of characters in the input with the first one repeated by the second.

8088 Assembly, IBM PC DOS, 24 bytes
Binary xxd dump:
00000000: d1ee add0 e88a c8ad 80ec 308a dcb4 0ecd  ..........0.....
00000010: 10fe cb75 f8e2 f0c3                      ...u....

Unassembled listing:
D1 EE       SHR  SI, 1          ; point SI to DOS PSP (080H)
AD          LODSW               ; load input length into AL
D0 E8       SHR  AL, 1          ; half input length to get number of CN pairs
8A C8       MOV  CL, AL         ; move into counter
        C_LOOP:
AD          LODSW               ; Load pair: C = AL, N = AH
80 EC 30    SUB  AH, '0'        ; ASCII convert N to binary
8A DC       MOV  BL, AH         ; BL is counter for number of reps of C
        N_LOOP:
B4 0E       MOV  AH, 0EH        ; BIOS teletype output function
CD 10       INT  10H            ; call BIOS, display C
FE CB       DEC  BL             ; decrement loop counter
75 F8       JNZ  N_LOOP         ; if end of N loop, move to next C
E2 F0       LOOP C_LOOP         ; loop through all C's
C3          RET                 ; return to DOS

Standalone DOS executable program. Input via command line, output to console.

Senva, 33 bytes
I was first making a big answer with a large code into the back-memory, but finally I made that :
1'(`>0.>{@}0'{v}1'0,>48-0,-<~>$>$

Here is an explanation :
1'  // Go to the second cell, the first will be used to store an information
(   // Input a string
`   // Go to the last cell (at the last character of the string)
>   // Make a new cell after the string
0.  // Store a 0 to mark the end of the string
>   // Make a new cell
{@} // Store this adress into the back-memory
0'  // Go to the 1st cell
{v} // Paste the adress, now the 1st cell contains the adress which points after the '0' which marks the end of the string
1'  // Go to the 2nd cell (the beginning of the string)
0,  // While we do NOT encounter a zero (while the string is not terminated)
  >   // Go to the next cell (the repeat number)
  48- // Substract 48 to get the number (the string was stored as an ASCII chain)
  0,  // While this cell is not equal to 0 (higher than 0)
    - // Decrease the cell
    < // Go to the cell which contains the character to repeat
    ~ // Display it
    > // Go to the number
  $ // End of the loop
  > // Go to the next number
$ // End of the loop

So we make a loop across the string, and a second loop into which display the C character `` times.

Gema, 17 16 characters
??=@repeat{$2;?}

Sample run:
bash-4.3$ gema '??=@repeat{$2;?}' <<< ":144,1'1"
:4444,'

Try it online!

C++ - 151 144 142 bytes
#include <iostream>
#include <string>
void f(){std::string p;std::cin>>p;for(int i=0,j;i<p.size();i+=2)for(j=48;j<p[i+1];j++)std::cout<<p[i];}

Way too long. I should probably just use an character pointer instead and forget the whole string thing.
2 bytes saved by @PeterTaylor!
Explanation:
void f()
{
    std::string p; // A string to hold the input.
    std::cin >> p; // Read the input from STDIN, and source to <p>.

    // Loop until the end of the string <p>, withs index jumps of 2 at each iteration.
    for(int i = 0, j; i < p.size(); i += 2)

        // Loop (p[i + 1] - 48) times, and print the current character each time.
        /* p[i + 1] - 48 is a neat way to convert the next character in the string
           to its integer digit from. */
        for(j = 48; j < p[i + 1]; j++)
            std::cout << p[i]; // Print the character we are at.
}

for(j=0;j<p[i+1]-48;j++): since you're not using j inside the loop, you can save two chars with for(j=48;j<p[i+1];j++)

@PeterTaylor Good catch, thanks!

><> - 36 Bytes
i:01-=?; l2=?v
v?=*68:ro:r-1<
>~~d0.

This solution can be run without using the input flag or preloading the stack, although both of those methods could cut down on bytes. If there is any interest, I can describe how it works to anyone who is curious.
Try it here!

JavaScript, 40 bytes
f=v=>v&&v[0].repeat(v[1])+f(v.slice(2))

Recursive.  Expand first 2 characters and call self with remainder of string.

Ahead, 12 bytes
~W:k-1'ii@j~

Explained
Single line Ahead boards are nice because you can explain them without some kind of diagram.
(Program effectively loops in reverse by floating)

~            float to next ~ (to end of line)
          ~  stop floating (end of line, turn around)
         j   jump next
       i     read char from input
        @    bounce here and die if input is empty, else continue west
      i      read digit char from input
   -1'       subtract '1 (49) from input char to get digit value
  :          dup first char that many times
 W           Write stack to output as chars
~            (repeat until head dies from empty input)

Try it online!

Clojure, 60 bytes
#(apply str(for[[c n](partition 2 %)_(range(-(int n)48))]c))

I assume we can take the input as an argument and return the string. If not this grows to 73 bytes:
#(pr(apply str(for[[c n](partition 2(read-line))_(range(-(int n)48))]c))

SmileBASIC, 54 bytes
LINPUT S$WHILE I<LEN(S$)?S$[I]*VAL(S$[I+1]);
I=I+2WEND

Alternative (same size):
LINPUT S$WHILE""<S$?SHIFT(S$)*VAL(S$[1]);
S$[0]="
WEND

Really wanted to write ?SHIFT(S$)*VAL(SHIFT(S$)) but expressions are evaluated right to left, so the shifts would happen in the wrong order...

Python 2, 40 bytes
f=lambda s:s and s[0]*int(s[1])+f(s[2:])

Try it online!

Husk, 9 7 bytes
ṁΓ·RrC2

Try it online!

Use Γ to access the head and tail of a list more efficiently: Try it online!

@Zgarb I'd like to know more about how this works in chat.


text:
N Doors, K Monkeys
There are N doors and K monkeys. Initially, all the doors are closed.
Round 1: The 1st monkey visits every door and toggles the door (if the door is closed, it gets opened it; if it is open, it gets closed).
Round 2:  The 1st monkey visits every door and toggles the door. Then The 2nd monkey visits every 2nd door and toggles the door.
. . .
. . .
Round k:  The 1st monkey visits every door and toggles the door .  .   .  .  .  .  .  .  .  .  The kth monkey visits every kth door and toggles the door.
Input :
N K (separated by a single space)
Output:
Door numbers which are open, each separated by a single space.
Example:
Input:
3 3
Output:
1 2
Constraints:
0< N<101
0<= K<= N
Note:

Assume N doors are numbered from 1 to N and K monkeys are numbered from 1 to K
The one with the shortest code wins. Also, display output for N=23, K=21

inspired by this puzzle?

I just have a question, if N=K, every prime number door is open, right?

@Fabinout no n=k=3 would output 1 2 so ur wrong... and 5 outputs 1 2 4 there is a pattern but its alot less obvious then that.

@Fabinout it follows a very weird type of Fibonacci number set, its very advanced abstract mathematics.

@tryingToGetProgrammingStraight you're right, my memories told me the answer was the list of prime numbers, when it was the list of square numbers.

@Fabinout the reason behind that, is that every number has an even number of factors, b/c for every factor there is the number u multiply it by, aside square numbers which are divisible by a odd amount of numbers. (hope thats clear enough)

APL, 32 28 26
{(2|+/(⍳⍺)∘.{+/0=⍺|⍨⍳⍵}⍳⍵)/⍳⍺}/⎕

⎕:
      23 21
 1 2 4 8 9 16 18 23

Explaination

{+/0=⍺|⍨⍳⍵} is a function that returns the number of times door ⍺(left argument) is toggled on round ⍵(right argument), which equal the number of factors of ⍺ that is ≤⍵:

⍳⍵ Generate numerical array from 1 to ⍵
⍺|⍨ Calculate ⍺ modulus each every item of that array
0= Change to a 1 where there was a 0, and a 0 for every thing else
+/ Sum the resulting array

The outer function:

(⍳⍺) , ⍳⍵ Generate arrays from 1 to N and 1 to K
∘.{...} For every pair of elements of the two arrays, apply the function. This gives a matrix of number of times toggled, each row represents a door and each column represents a round.
+/ Sum the columns. This gives an array of the number of times each door is toggled over all rounds.
2| Modulus 2, so if a door is open, it's a 1; if it's closed, it's a 0.
(...)/⍳⍺ Finally, generate an array from 1 to N and select only the ones where there is a 1 in the array on the previous step.

/⎕ Finally, insert the function between the numbers from input.

EDIT
{(2|+⌿0=(,↑⍳¨⍳⍵)∘.|⍳⍺)/⍳⍺}/⎕

,↑⍳¨⍳⍵ Generate all "monkeys" (If K=4, then this is 1 0 0 0 1 2 0 0 1 2 3 0 1 2 3 4)

⍳⍵ Array from 1 to ⍵ (K)
⍳¨ For each of those, generate array from 1 to that number
,↑ Convert the nested array into a matrix (↑) and then unravel to a simple array (,)

(,↑⍳¨⍳⍵)∘.|⍳⍺ For each number from 1 to ⍺ (N), mod it with each monkey.
0= Change to a 1 where there was a 0, and a 0 for every thing else. This gives a matrix of toggles: Rows are each monkey on each round, columns are doors; 1 means a toggle, 0 means no toggle.
+⌿ Sum the rows to get an array of number of times each door is toggled

Other parts are not changed

EDIT
{(≠⌿0=(,↑⍳¨⍳⍵)∘.|⍳⍺)/⍳⍺}/⎕

Use XOR reduce (≠⌿) instead of sum and mod 2 (2|+⌿)

Was APL designed for golf script? ;-)

@celtschk Yes, partly, in a way. It was designed to express algorithms concisely.

Why do you use a dfn reduction {}/ instead of just taking N and K as arguments to the dfn?

@Adám Because 1) this is past me; 2) this question predates the "program or function" and I/O standardizations; 3) the OP specifically said "separated by a single space"

Fair enough, but at least you can save a byte with i←⍳⍺

Scroll down. My 26-byte submission is near the bottom. (I know, but this is past me)

GolfScript, 33 characters
~:k;),1>{0\{1$)%!k@-&^}+k,/}," "*

If doors were numbered starting with zero it would save 3 characters.
Examples (online):
> 3 3
1 2

> 23 21
1 2 4 8 9 16 18 23

Mathematica, 104 chars
{n,k}=FromDigits/@StringSplit@InputString[];Select[Range@n,OddQ@DivisorSum[#,If[#>k,0,k+1-#]&]&]~Row~" "

Example:

In[1]:= {n,k}=FromDigits/@StringSplit@InputString[];Select[Range@n,OddQ@DivisorSum[#,If[#>k,0,k+1-#]&]&]~Row~" "
? 23 21
Out[1]= 1 2 4 8 9 16 18 23

You can knock another 15 characters off parsing the input by assuming an input stream, e.g.: {n,k}=%~Read~{Number,Number}.

Ruby, 88
Based on @manatwork's answer.
gets;~/ /
$><<(1..$`.to_i).select{|d|(1..k=$'.to_i).count{|m|d%m<1&&(k-m+1)%2>0}%2>0}*$&

Those dodgy globals always break syntax highlighting!

Sorry, but the 90 chars (revision 2) and 86 chars (revision 3) seems to be buggy: a new number, 22, appeared in their results.

@manatwork good call, I think I've fixed it now at the cost of two characters.  I feel like that count bit could be improved further, I wish ruby had a built in #sum method for things like that :>

Wow! Really impressed.

Python 3, 97 84
If a monkey appears in an even number of rounds, that's no change at all.
If a monkey appears in an even number of times, that's the same as in exactly one round.
Thus some monkeys can be left out, and the others just have to switch doors once.
N,K=map(int,input().split())
r=set()
while K>0:r^=set(range(K,N+1,K));K-=2
print(*r)

Output for 23 21:
1 2 4 8 9 16 18 23

Clever use of set operations! I think you can shorten range(2-K%2,K+1,2) to range(K,0,-2).

Or better yet, replace the for loop with a while loop: while K>0:r^=set(range(K,N+1,K));K-=2

@xnor: thanks, that's great!

javascript 148 127
function e(n,k){b=array(n);d=[];function a(c){for(i=0;i<n;i+=c)b[i]=!b[i];c<k&&a(c+1)}a(1);for(i in b)b[i]&&d.push(i);return d}

here is a (tiny bit) readable version:
function e(n, k) {     //define N and K
     b = array(n); //declare all doors as closed
     d = [];     //create array later used to print results

     function a(c) {   //(recursive) function that does all the work
         for (i = 0; i < n; i += c)  //increment by c until you reach N and...
              b[i] = !b[i];  //toggle said doors
         c < k && a(c + 1)  //until you reach k, repeat with a new C (next monkey)
     }
     a(1); //start up A

     for (i in b) b[i] && d.push(i); //convert doors to a list of numbers
     return d //NO, i refuse to explain this....
}   //closes function to avoid annoying errors

DEMO fiddle
i should note that it starts counting from 0 (technically a off-by-one error)

You can remove your 3rd line if you change the 2nd line to b=Array(n); This initializes your array as n length filled with undefined. !undefined is true, so the first monkey pass will turn it all into trues.

@path411 thank u very much! im surprised i forgot how "proper" array declaration works! you can feel free to +1

Interesting. It seems yours is the only one I've seen so far that appears to get a similar answer as mine for N=23, K=21. The only difference being the off-by-one issue which includes 0 and excludes 23.

Figured out what's wrong with mine, and this one has the same problem. For each round, you're only sending one monkey through all the doors. However, per the challenge specifications, there needs to be $i monkeys running through each round - where $i is the number of the round you're on.

R - 74
x=scan(n=2);cat(which(colSums((!sapply(1:x[1],`%%`,1:x[2]))*x[2]:1)%%2>0))

Simulation:
> x=scan(n=2);cat(which(colSums((!sapply(1:x[1],`%%`,1:x[2]))*x[2]:1)%%2>0))
1: 23 21
Read 2 items
1 2 4 8 9 16 18 23

JavaScript, 153
(function(g){o=[],f=g[0];for(;i<g[1];i++)for(n=0;n<=i;n++)for(_=n;_<f;_+=n+1)o[_]=!o[_];for(;f--;)o[f]&&(l=f+1+s+l);alert(l)})(prompt().split(i=l=s=' '))

Output for N=23, K=21:
1 2 4 8 9 16 18 23

Tested in Chrome, but doesn't use any fancy new ECMAScript features so should work in any browser!
I know I'll never win against the other entries and that @tryingToGetProgrammingStrainght already submitted an entry in JavaScript, but I wasn't getting the same results for N=23, K=21 as everyone else was getting with that so I thought I'd have a go at my own version.
Edit: annotated source (in looking over this again, I spotted places to save another 3 characters, so it can probably be improved still...)
(function(g) {
    // initialise variables, set f to N
    o = [], f = g[0];

    // round counter
    // since ++' ' == 1 we can use the same variable set in args
    for (; i < g[1]; i++)
        // monkey counter, needs to be reset each round
        for (n = 0 ; n <= i; n++)
            // iterate to N and flip each Kth door
            for (_ = n; _ < f; _ += n + 1)
                // flip the bits (as undef is falsy, we don't need to initialise)
                // o[_] = !~~o[_]|0; // flips undef to 1
                o[_] = !o[_]; // but booleans are fine
    // decrement f to 0, so we don't need an additional counter
    for (;f--;)
        // build string in reverse order
        o[f] && (l = f + 1 + s + l); // l = (f + 1) + ' ' + l
    alert(l)
    // return l // use with test
// get input from user and store ' ' in variable for use later
})(prompt().split(i = l = s = ' '))
// })('23 21'.split(i = l = s = ' ')) // lazy...

// == '1 2 4 8 9 16 18 23  '; // test

good work! if you would also provide a readable and commented version i would probably +1

Answer updated! Since I can't comment on your answer, to add to @path411's comment, you could set b=[] and the empty indexes are still undefined and that saves you another 6 characters!

i did that already....

Ruby - 65 characters
(1..n).each{|d|
t=0
(1..k).each{|m|t+=n-m+1 if d%m==0}
p d if t%2>0}

n = 23, k = 21 # => 1 2 4 8 9 16 18 23

Here is the calculation, in pseudo-code:

Let s(d) be the number of times door d is touched after k rounds.
s(d) = sum(m=1..m=k)(d%m==0 ? (n-m+1): 0)
door d is open after k rounds if s(d) % 2 = 1 (or > 0)

If you are not convinced that the expression for s(d) is correct, look at it this way:

Let s(d,r) be the number of times door d is touched after r rounds.
s(d,k) - s(d,k-1)                            = sum(m=1,..,m=k)(d%m==0 ? 1 : 0)
s(d,k-1) - s(d,k-2)                 = sum(m=1,..,m=(k-1))(d%m==0 ? 1 : 0)
...
s(d,2) - s(d,1) = d%2==0 ? 1 : 0
s(d,1) = 1
sum both sides to obtain the above expression for s(d), which equals s(d,k)

Very concise!  Where do n and k come from, though?  And the output seems to be separated by newlines rather than spaces.

PowerShell: 132
Golfed Code:
$n,$k=(read-host)-split' ';0|sv($d=1..$n);1..$k|%{1..$_|%{$m=$_;$d|?{!($_%$m)}|%{sv $_ (!(gv $_ -Va))}}};($d|?{(gv $_ -Va)})-join' '

Un-Golfed, Commented Code:
# Get number of doors and monkeys from user as space-delimited string.
# Store number of doors as $n, number of monkeys as $k.
$n,$k=(read-host)-split' ';

# Store a list of doors in $d.
# Create each door as a variable set to zero.
0|sv($d=1..$n);

# Begin a loop for each round.
1..$k|%{

    # Begin a loop for each monkey in the current round.
    1..$_|%{

        # Store the current monkey's ID in $m.
        $m=$_;

        # Select only the doors which are evenly divisible by $m.
        # Pass the doors to a loop.
        $d|?{!($_%$m)}|%{

            # Toggle the selected doors.
            sv $_ (!(gv $_ -Va))
        }
    }
};

# Select the currently open doors.
# Output them as a space-delimited string.
($d|?{(gv $_ -Va)})-join' '

# Variables cleanup - don't include in golfed code.
$d|%{rv $_};rv n;rv d;rv k;rv m;

# NOTE TO SELF - Output for N=23 K=21 should be:
# 1 2 4 8 9 16 18 23

Oh, I see what my problem is. I misunderstood the question - this is not the 100 Lockers problem. It's that, taken up a notch! This will require a bit more work...

Sweet! Fixing it to meet the challenge requirements properly only netted a gain of 6 characters in the end.

Powershell, 66 bytes

Based on Cary Swoveland's answer.

param($n,$k)1..$n|?{$d=$_
(1..$k|?{($n-$_+1)*!($d%$_)%2}).Count%2}

Test script:
$f = {

param($n,$k)1..$n|?{$d=$_
(1..$k|?{($n-$_+1)*!($d%$_)%2}).Count%2}

}

@(
    ,(3, 3   , 1,2)
    ,(23, 21 , 1, 2, 4, 8, 9, 16, 18, 23)
) | % {
    $n,$k,$expected = $_
    $result = &$f $n $k
    "$("$result"-eq"$expected"): $result"
}

Output:
True: 1 2
True: 1 2 4 8 9 16 18 23

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:
Minimum number of Jumps
Given a sequence of numbers, find the minimum number of jumps to go from the starting position to the end and come back to the starting position again.
Each element of the sequence denotes the maximum number of moves that one can move from that position.
At any position, you can make a jump of at max k moves, where k is the value stored at that position. After reaching the end, you can use only those positions for jumping which have not been used previously for jumping.
The input will be given as a sequence of numbers separated by single-spaces.
Output should be a single number which is the minimum number of jumps used.
If its not possible to go to the end and come back to the starting position, then print -1
Input:
2 4 2 2 3 4 2 2
Output:
6 (3 to reach end and 3 to come back)
Input
1 0
Output
-1
Note

Assume all the numbers of the sequence are non-negative

EDIT 1
The line "Thus, it should be clear that one can always jump from the last position." might be confusing, so I removed it from the question. It will have no effect on the question.
Winning Criteria :
The winner will be the one with the shortest code.

Thus, it should be clear that one can always jump from the last position. - isn't 1 0 a counterexample?

@Daniel No. Number of jumps will be equal to the value stored at that position. The last position is always a candidate from which one can jump since this position was not used previously for jumping.

This description is confusing because "jumps" is used to mean two different things, and with only one actual example, it's difficult to disambiguate which meaning goes with which usage. I'd prefer a description which referred to, say, "jumps" and "moves". With this terminology, you would say that each move consists of some number of jumps. The numbers in the input provide the maximum number of jumps, and the output can be unambiguously described as reporting the minimum number of moves.

What is the winning criterion? As you tagged [tag:code-golf] as well as [tag:code-challenge] it is not clear.

@breadbox Yes. I agree, its ambiguous. I will update the question soon.

@Howard I removed the tag code-challenge

Answer to [2] is 0 ? And, what is the answer to [0]?

What should happen if you go beyond the last spot? Will you move back right away? 1 2 2 3 2. Would it go to the following positions 1 2 4 3 1 or should that print -1?

Mathematica, 197 193 chars
Brute force.
Min[Length/@Select[Join[{1},#,{n},Reverse@#2]&@@@Tuples[Subsets@Range[3,n=Length[i=FromDigits/@StringSplit@InputString[]]]-1,2],{}⋃#==Sort@#∧And@@Thread[i[[#]]≥Abs[#-Rest@#~Append~1]]&]]/.∞->-1

Very impressive work. It may be brute force but it is very elegant, nonetheless.

APL(Dyalog), 116
f←{{⊃,/{2>|≡⍵:⊂⍵⋄⍵}¨⍵}⍣≡1{(⍴⍵)≤y←⊃⍺:⍵⋄⍵[y]=0:0⋄x←⍵⋄x[y]←0⋄∇∘x¨,∘⍺¨y+⍳y⌷⍵},⍵}
{0≡+/⍵:¯1⋄(⌊/+/0=⍵)-+/0=x}↑⊃,/f¨⌽¨f x←⎕

Test cases
      2 4 2 2 3 4 2 2
6
      1 0
¯1
      1 1 1 1
¯1
      3 1 2 0 4
3
      1
0

Approach
The approach is a brute force search using a recursive function.
Starting from position 1, set value at the current position to 0 and generate an array of the positions which can be jumped to from the current position. Pass the new position and the modified array to itself. Base cases are when the value at the current position is 0 (can't jump) or reaching the end.
Then, for each of the array generated, reverse it and do the search again. Because jumped positions are set to 0, we can't jump from there again.
For those array which we reached the end, find the ones which have the minimum number of 0's. Subtracting from it the number of 0's in the initial array gives the actual number of jumps performed.

Mathematica 351
[Note: This is not yet fully golfed; Also, the input needs to be adjusted to fit the required format.  And the no-jumping-on-the-same-position-twice rule needs to be implemented. There are also some code formatting issues that need addressing. But it's a start.]
A graph is constructed with nodes corresponding to each position, i.e. each input digit representing a jump.  DirectedEdge[node1, node2] signifies that it is possible to jump from node1 to node 2.  Shortest paths are found from start to end and then from end to start.
f@j_:=
(d={v=FromCharacterCode/@(Range[Length[j]]+96),j}\[Transpose];
w[n_,o_:"+"]:={d[[n,1]],FromCharacterCode/@(ToCharacterCode[d[[n,1]]][[1]]+Range[d[[n,2]]]
If[o=="+",1,-1])};

y=Graph[Flatten[Thread[DirectedEdge[#1,#2]]&@@@(Join[w[#]&/@Range[8],w[#,3]&/@Range[8]])]];

(Length[Join[FindShortestPath[y,v[[1]],v[[-1]]],FindShortestPath[y,v[[-1]],v[[1]]]]]-2)
/.{0-> -1})

Usage
f[{2,4,2,2,3,4,2,2}]
f[{3,4,0,0,6}]
f[{1,0}]

6
3
-1

This is partially wrong since it doesn't enforce the no jumping on a number twice rule, but it's a start, so I'll upvote for that. I had no idea if this was even possible :)

You are correct.  I overlooked  the no-jumping-on-a number-twice rule  Tomorrow I'll try to correct that.

Python 304
I think this new approach solves (I hope!) all the issues regarding the [2,0] case and similar:
In this version the input sequence is traversed (if possible) until the end and then
we start the process again with the reversed sequence. Now we can garantee that for every valid solution one of the the jumps lands on the last element.
## Back and forward version

# Changed: now the possible jumps from a given L[i] position
# are at most until the end of the sequence
def AvailableJumps(L,i): return range(1,min(L[i]+1,len(L)-i))

# In this version we add a boolean variable bkw to keep track of the
# direction in which the sequence is being traversed
def Jumps(L,i,n,S,bkw):
    # If we reach the end of the sequence...
    # ...append the new solution if going backwards
    if (bkw & (i == len(L)-1)):
            S.append(n)
    else:
        # ...or start again from 0 with the reversed sequence if going forward
        if (i == len(L)-1):
            Jumps(L[::-1],0,n,S,True)
        else:
            Laux = list(L)
            # Now we only have to disable one single position each time
            Laux[i] = 0
            for j in AvailableJumps(L,i):
                Jumps(Laux,i+j,n+1,S,bkw)

def MiniJumpBF(L):
    S = []
    Jumps(L,0,0,S,False)
    return min(S) if (S) else -1

These are the golfed versions:
def J(L,i,n,S,b):
    if (i == len(L)-1):
        S.append(n) if b else J(L[::-1],0,n,S,True)
    else:
        L2 = list(L)
        L2[i] = 0
        for j in range(1,min(L[i]+1,len(L)-i)):
            J(L2,i+j,n+1,S,b)
def MJ(L):
    S = []
    J(L,0,0,S,False)
    return min(S) if (S) else -1

And some examples:
MJ( [2, 4, 2, 2, 3, 4, 2, 2] ) -->  6
MJ( [0, 2, 4, 2, 2, 3, 4, 2, 2] ) -->  -1
MJ( [3, 0, 0, 1, 4] ) -->  3
MJ( [2, 0] ) -->  -1
MJ( [1] ) -->  0
MJ( [10, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 10] ) -->  4
MJ( [3, 2, 3, 2, 1] ) -->  5
MJ( [1, 1, 1, 1, 1, 1, 6] ) -->  7
MJ( [7, 1, 1, 1, 1, 1, 1, 7] ) -->  2

Has huge potential for further golfing. But there's no handling of input and output, which is part of this problem.

you have tons of unnecessary whitespace...

R - 195
x=scan(nl=1)
L=length
n=L(x)
I=1:(2*n-1)
P=n-abs(n-I)
m=0
for(l in I)if(any(combn(I,l,function(i)all(P[i[c(1,k<-L(i))]]==1,n%in%i,L(unique(P[i]))==k-1,diff(i)<=x[P][i[-k]])))){m=l;break}
cat(m-1)

Simulation:
1: 2 4 2 2 3 4 2 2   # everything after 1: is read from stdin
6                    # output is printed to stdout

1: 1 0               # everything after 1: is read from stdin
-1                   # output is printed to stdout

De-golfed:
x = scan(nlines = 1)       # reads from stdin
n = length(x)
index    = 1:(2*n-1)       # 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
position = c(1:n, (n-1):1) # 1  2  3  4  5  6  7  8  7  6  5  4  3  2  1
value    = x[position]     # 2  4  2  2  3  4  2  2  2  4  3  2  2  4  2
is_valid_path = function(subindex) {
  k = length(subindex)
  position[subindex[1]] == 1                  & # starts at 1
  position[subindex[k]] == 1                  & # ends at 1
  n %in% subindex                             & # goes through n (end of vector)
  length(unique(position[subindex])) == k - 1 & # visits each index once (except 1)
  all(diff(subindex) <= value[subindex[-k]])
}
min_length = 0
for(len in index) {
  valid_paths = combn(index, len, FUN = is_valid_path)
  if (any(valid_paths)) {
    min_length = len
    break
  }
}
min_jumps = min_length - 1
cat(min_jumps)             # outputs to stout

Python 271
this is my solution:
## To simplify the process we unfold the forward-backward sequence
def unfold(L): return L + L[:-1][::-1]

## Possible jumps from a given L[i] position
def AvailableJumps(L,i): return range(1,L[i]+1)

# To disable a used position, in the forward and backward sites
# (the first one is not really necessary)
def Use(L,i):
    L[i] = 0
    L[ len(L) - i - 1] = 0
    return L

def Jumps(L,i,n,S):
    if (i >= len(L)-1):
        S.append(n)
    else:
        Laux = list(L)
        Use(Laux,i)
        for j in AvailableJumps(L,i):
            Jumps(Laux,i+j,n+1,S)

def MiniJump(L):
    S = []
    Jumps(unfold(L),0,0,S)
    return min(S) if (S) else -1

Examples:
print MiniJump([2,4,2,2,3,4,2,2])
print MiniJump([0,2,4,2,2,3,4,2,2])

And these are the (partially by now) golfed versions:
def J(L,i,n,S):
    if (i >= len(L)-1): S.append(n)
    else:
        La = list(L)
        La[len(La) - i - 1] = 0
        for j in range(1,L[i]+1):
            J(La,i+j,n+1,S)

def MJ(L):
     S = []
     J(L + L[:-1][::-1],0,0,S)
     return min(S) if (S) else -1

Some examples:
print MJ([2,4,2,2,3,4,2,2])
print MJ([0,2,4,2,2,3,4,2,2])
print MJ([3,4,0,0,6])

Wrong. At input [1], output should be 0(your output is 1). At input [3,0,0,1,4], output should be 3 (your output is -1)

@Coding man: Oops, sorry. There was an exrtra jump check. if (i >= len(L)-1): S.append(n) seems to solve the problem

Still giving wrong outputs. Ex: [2,0] ---> 1 (should be -1).

@Coding man: I think my solution is in conflict with the "Thus, it should be clear that one can always jump from the last position.", as I consider [2,0] ---> 1 a valid solution, since it jumps across the end.

I apologize for all these mistakes. The line "Thus, it should be clear that one can always jump from the last position." has been removed. It was used just to mean that last position was never used when we move forward in the sequence. So, it can always be used for jumping when we move backward. But, in [2,0] the value at last position is 0, you can make a jump of at max 0 moves. Hence, you can never reach the starting position. The question has been updated.

Ruby - 246
a=gets.split.map &:to_i
L=a.size;r=[];a.collect!{|v|([1,v].min..v).to_a};S=a[0].product *a[1..-1];S.each{|s|i=0;b=L==1&&s[i]!=0 ?0:1;(L*2).times{|c|r<<c if i==L-1&&b==0;break if !s[i]||s[i]==0;if i==L-1;b=i=0;s.reverse!end;i+=s[i]}}
puts r.min||-1

Simulation:
2, 4, 2, 2, 3, 4, 2, 2
6

0, 2, 4, 2, 2, 3, 4, 2, 2
-1

0
-1

1
0

Ruby - about 700 golfed.  I started a golfed version, with single-character names for variables and methods, but after awhile I got more interested in the algorithm than the golf, so stopped trying to optimize code length.  Nor did I worry about getting the input string.  My effort is below.
To help you understand how it works I've included comments that show how a particular string (u = "2 1 4 3 0 3 4 4 3 5 0 3") is manipulated.  I enumerate combinations of "rocks in the stream" that are available to hop on. These are represented with a binary string. I give the example 0b0101101010 in the comments and show how it would be used. The 1's correspond to the positions of rocks available for the initial trip; the 0's for the return trip.  For each such allocation, I use dynamic programming to determine the minimal number of hops required in each direction.  I also perform a few simple optimizations to eliminate some combinations early on.
I've run it with the strings given in other answers and get the same results.  Here are some other results I obtained:
"2 1 4 3 0 3 4 4 3 5 0 3"                             # =>  8
"3 4 3 5 6 4 7 4 3 1 5 6 4 3 1 4"                     # =>  7
"2 3 2 4 5 3 6 3 2 0 4 5 3 2 0 3"                     # => 10
"3 4 3 0 4 3 4 4 5 3 5 3 0 4 3 3 0 3"                 # => 11
"2 3 2 4 5 3 6 3 2 0 4 5 3 2 0 3 4 1 6 3 8 2 0 5 2 3" # => 14

I would be interested in hearing whether others get the same results for these strings.  Performance is reasonable good.  For example, it took less than a minute to get a solution for this string:
"3 4 3 0 4 3 4 4 5 3 5 3 0 4 3 3 0 3 4 5 3 2 0 3 4 1 6 3 2 0 4 5 3 2 0 3 4 1 6 3 0 4 3 4 4 5 0 1"
The code follows.
I=99 # infinity - unlikely we'll attempt to solve problems with more than 48 rocks to step on

def leap!(u)
  p = u.split.map(&:to_i) # p = [2,1,4,3,0,3,4,4,3,5,0,3]
  s = p.shift        # s=2, p =   [1,4,3,0,3,4,4,3,5,0,3] # start
  f = p.pop          # f=3, p =   [1,4,3,0,3,4,4,3,5,0]   # finish
  q = p.reverse      #      q =   [0,5,3,4,4,3,0,3,4,1]   # reverse order
  # No path if cannot get to a non-zero rock from s or f
  return -1 if t(p,s) || t(q,f)
  @n=p.size                  # 10 rocks in the stream
  r = 2**@n                  # 10000000000 - 11 binary digits
  j = s > @n ? 0 : 2**(@n-s) #   100000000 for s = 2 (cannot leave start if combo number is smaller than j)
  k=r-1                      #  1111111111 - 10 binary digits

  b=I # best number of hops so far (s->f + f->s), initialized to infinity
  (j..k).each do |c|
    # Representative combo: 0b0101101010, convert to array
    c += r                     # 0b10 1 0 1 1 0 1 0 1 0
    c = c.to_s(2).split('').map(&:to_i)
                               # [1,0,1,0,1,1,0,1,0,1,0]
    c.shift                    #   [0,1,0,1,1,0,1,0,1,0] s->f: rock offsets available: 1,3,4,6,8
    d = c.map {|e|1-e}.reverse #   [1,0,1,0,1,0,0,1,0,1] f->s: rock offsets available: 0,2,5,7,9
    c = z(c,p)                 #   [0,4,0,0,3,0,4,0,5,0] s->f: max hops by offset for combo c
    d = z(d,q)                 #   [0,0,3,0,4,0,0,3,0,1] f->s: max hops by offset for combo c
    # Skip combo if cannot get from to a rock from f, or can't
    # get to the end (can always get to a rock from s if s > 0).
    next if [s,f,l(c),l(d)].max < @n && t(d,f)
    # Compute sum of smallest number of hops from s to f and back to s,
    # for combo c, and save it if it is the best solution so far.
    b = [b, m([s]+c) + m([f]+d)].min
  end
  b < I ? b : -1 # return result
end

# t(w,n) returns true if can conclude cannot get from sourch n to destination
def t(w,n) n==0 || (w[0,n].max==0 && n < @n) end
def l(w) w.map.with_index {|e,i|i+e}.max end
def z(c,p) c.zip(p).map {|x,y| x*y} end

def m(p)
  # for s->f: p = [2,0,4,0,0,3,0,4,0,5,0] - can be on rock offsets 2,5,7,9
  # for f->s: p = [3,0,0,3,0,4,0,0,3,0,1] - can be on rock offsets 3,5,8,10
  a=[{d: 0,i: @n+1}]
  (0..@n).each do |j|
    i=@n-j
    v=p[i]
    if v > 0
      b=[I]
      a.each{|h| i+v < h[:i] ? break : b << (1 + h[:d])}
      m = b.min
      a.unshift({d: m,i: i}) if m < I
    end
  end
  h = a.shift
  return h[:i]>0 ? I : h[:d]
end

Haskell, 173 166 bytes, 159 bytes in GHCi
Here is the normal version:
import Data.List
t=length
j[_]=0
j l=y[t f|f<-fst.span(>0)<$>permutations[0..t l-1],u<-f,u==t l-1,all(\(a,b)->abs(b-a)<=l!!a)$zip(0:f)$f++[0]]
y[]=0-1
y l=minimum l+1

Here is the GHCi answer (put the line one at a time):
t=length
y[]=0-1;y l=minimum l+1
j[_]=0;j l=y[t f|f<-fst.span(>0)<$>Data.List.permutations[0..t l-1],u<-f,u==t l-1,all(\(a,b)->abs(b-a)<=l!!a)$zip(0:f)$f++[0]]

Just a bruteforce. Generate the possible answer. (i.e. permutation of [0..n-1] with zero and following element dropped. Then check if the answer is correct. Get the minimum length and add by one. (Since the leading and trailing zeroes is delete).
How to use: j[3,4,0,0,6] -> 3

Data.List.permutations does not work in GHC, but only in GHCi. According to our Guide to Golfing Rules in Haskell, you should either add the import or mark your answer as "Haskell GHCi". The first option is generally preferred by Haskell golfers on this site.

Instead of a<-permutations[0..t l-1],let f=takeWhile(/=0)a, you can write f<-map(takeWhile(/=0))(permutations[0..t l-1]), which again can be golfed to f<-fst.span(>0)<$>permutations[0..t l-1]. With this you are back to 166 bytes even by adding the import: Try it online!

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


text:
Creating a HQ9+ interpreter
The goal of this code golf is to create an interpreter for the programming language HQ9+
There are 4 commands in this programming language:

H - prints "Hello, world!"
Q - prints the source code of the program
9 - prints the lyrics of the song "99 bottles of beer"
+ - increments the accumulator

The rules:

Because the accumulator isn't defined, you can ignore the command +
Your program should prompt for input (this input will be the source code) or the source code is read from a file
You are not allowed to put the lyrics of "99 bottles of beer" in a file, and read the text from the file
You are not allowed to use a compression algorithm such as GZip or BZip to compress the song text: you have to create your own compression algorithm. This doesn't have to be a complex algorithm, but try to compress the text as much as possible (remember: this is a code-golf, the code with the fewest bytes wins)
If the source code contains a char that isn't H, Q, 9 or +, then output "Source code contains invalid characters" before running any commands! This means that, if the source code is H1 for example, then don't output Hello, world! before you output Source code contains invalid characters. No, immediately output Source code contains invalid characters
If your interpreter accepts both uppercase and lowercase characters, then you get -8 to your character count

Good luck!

Rule 4 doesn't make sense at the "why would he prohibit that?!" level; rule 5 doesn't make sense at the "what does he mean?!" level.

How does rule 5 not make sense?

I think it would be better to just require it only uses uppercase, rather than arbitrarily saying you get a free 8 characters off if it accepts either. 8 may or may not cover it depending on the language.

Rule 5 does not make sense because it breaks the HQ9+ spec.

@boothby: OK, I removed that rule.

@MikeC, it said what you must not do, but it wasn't clear to me that it fully stated what you must do.

An interpreter in HQ9+ should automatically win.

No  because it doesn't accept input

do I get extra points if it accepts uppercase +?

APL (Dyalog) (326 - 8 = 318)
Paste it in an editor window and call H. Input is taken from the keyboard.
H
⎕←'Source code contains invalid characters'/⍨~∧/'HhQq9+'∊⍨V←⍞
B←' of beer'
W←' on the wall'
L←⎕TC[2]
Z←{k←' bottle','s'/⍨⍵≠1⋄⍵<0:'99',k⋄⍵=0:'No',k⋄k,⍨⍕⍵}
{⍵∊'Hh':⎕←'Hello, world!'
⍵∊'Qq':⎕←V
⍵∊'9':{⎕←G,K,(G←Z⍵),B,L,(⊃'Go to the store and buy some more' 'Take one down and pass it around'[1+×⍵]),L,(Z⍵-1),K←B,W,L}¨1-⍨⌽⍳100}¨V

C, 599 587 487 481 467 characters
I'm sure this can be beaten. I'm using C after all. There's a reason you don't see a lot of winning golf entries written in C. This is now 467 characters thanks to criminal abuse of #define.
Specify the HQ9+ source file as a command line argument.
EDIT: Now accepts the source from stdin, not a file. Start the program, start typing the code, CTRL‑C when done to run it.
It compiles at least in MinGW/GCC with: gcc -o hq9+.exe hq9+.c
Should work in MSVC, but I didn't feel like creating a whole solution just for this. :)
#define B "bottles of beer"
#define C case
#define P printf
#define R break
a,i,j,s;
main(){
char p[9999],c;
for(;;) {
    switch(c=getch()){
    C 'H':C 'Q':C '9':C '+': C 3: R;
    default:P("Source code contains invalid characters\n");
    }
    if (c==3) R;
    p[s++]=c;
}
for(i=0;i<s;i++){
    c = p[i];
    switch(c){
    C 'H':
        P("Hello world!");
        R;
    C 'Q':
        for(j=0;j<s;j++)putchar(p[j]);
        R;
    C '9':
        j=99;
        while(j){
            P("%d "B" on the wall,\n%d "B".\nTake one down, pass it around,\n%d "B".\n",j,j,j-1);
            j--;
        }
        R;
    C '+':
        a++;
    }
}
}

Or:
#define B "bottles of beer"
#define C case
#define P printf
#define R break
a,i,j,s;main(){char p[9999],c;for(;;){switch(c=getch()){C 'H':C 'Q':C '9':C '+': C 3: R;default:P("Source code contains invalid characters\n");}if (c==3) R;p[s++]=c;}for(i=0;i<s;i++){c = p[i];switch(c){C 'H':P("Hello world!");R;C 'Q':for(j=0;j<s;j++)putchar(p[j]);R;C '9':j=99;while(j){P("%d "B" on the wall,\n%d "B".\nTake one down, pass it around,\n%d "B".\n",j,j,j-1);j--;}R;C '+':a++;}}}

Got it down to 487 characters by using stdin instead of a file for input.

Make that 464 by abusing #define.

You could get rid of spaces, like the ones after C and a couple before R;. Could also shave off 8 chars with p[s++]=0; after the input loop to simplify printing p.

Mathematica, 349 346 341 chars
h = If[StringMatchQ[#, ("H" | "Q" | "9" | "+") ...],
   b = If[# > 0, ToString@#, "No"] <> " bottle" <>
      If[# == 1, "", "s"] <> " of beer" &;
   w = b@# <> " on the wall" &;
   Print /@
    StringCases[#, {"H" -> "Hello, world!", "Q" -> #,
      "9" -> "" <>
        Table[w@n <> ",\n" <> b@n <>
          ".\ntake one down, pass it around,\n" <> w[n - 1] <>
          If[n == 1, ".", ".\n\n"], {n, 99, 1, -1}]}];,
   "Source code contains invalid characters"] &

Very impressive but there appear to be some minor gliches.'h["Q"] outputs "Q".  h["9"] works, but h[9] outputs the whole program (I don't understand how.)

@DavidCarraher It outputs code due to how StringMatchQ and If fails: If[StringMatchQ[3, "a"], x, y]

Fortran 528 470 481
It requires compiling with -fpp flag (+3 to score)1 to use preprocessing directives (which saves way more than 3 chars, so I'm totally okay with that). It is also case insensitive, so there's -8 :D. Saved 5 chars by not preprocessing the endif as that is used once anyway.
Requires the file to have a .F90 extension (makes sense to call it hq9+.F90) so that the compiler forces preprocessing. The code is case-sensitive; making it case-insensitive adds something like 16 characters, so it's not really worth it to save 8 characters. My previous answer did not account for the changing plurals in bottles for 9; this version corrects it (and sadly adds a lot more characters).
#define P print*,
#define W " of beer on the wall"
#define N print'(x,i0,a,a)',
#define e enddo
#define S case
#define J len(trim(c))
character(len=99)::c,b=" bottles";read*,c;do i=1,J;if(all(c(i:i)/=["H","Q",'9',"+"])) then;P"Source code contains invalid characters";exit;endif;e;do i=1,J;select S(c(i:i));S("H");P"Hello, world!";S("Q");P c;S("9");l=8;do k=99,1,-1;N k,b(1:l),W;N k,b(1:l)," of beer";P "Take one down, pass it around";if(k==2)l=l-1;if(k==1)exit;N k-1,b(1:l),W;P"";e;P"No more",trim(b),W;S default;endselect;e;end

Looks a lot better ungolfed & non-preprocessed (probably because you can see what's going on):
program hq9
   character(len=99)::c,b=" bottles"
   read*,c
   do i=1,len(trim(c))
! change the below to ["H","h","Q","q","9","+"] to be case-insensitive
      if(all(c(i:i)/=["H","Q","9","+"]))then
         print*,"Source code contains invalid characters"
         exit
      endif
   enddo
   do i=1,len(trim(c))
      select case(c(i:i))
        case("H")                ! change to case("H","h") for case-insensitive
           print*,"Hello, world!"
        case("Q")                ! change to case("Q","q") for case-insensitive
           print*, c
        case("9")
           l=8
           do k=99,1,-1
              print'(x,i0,a,a)', k,b(1:l)," of beer on the wall"
              print'(x,i0,a)', k,b(1:l)," of beer"
              print*,"Take one down, pass it around"
              if(k==2) l=l-1
              if(k==1) exit
              print'(x,i0,a)', k-1,b(1:l)," of beer on the wall"
              print*,""
           enddo
           print*,"No more",trim(b)," of beer on the wall"
        case default
           ! do nothing
      endselect
   enddo
end program hq9

I think it's acceptable to require a specific extension to let the compiler know what it's compiling. An analog might be requiring a C++ file to be named .cc to avoid needing the -lstdc++ flag.

Python 2, 452 453 443 bytes
q=raw_input()
if set(q)-set('HQ9+'):print'Source code contains invalid characters'
b=' bottles of beer'
b=[b,b.replace('s','')]
w=[a+' on the wall'for a in b]
t='Take one down, pass it around,\n'
c={'H':'Hello, world!','Q':q,'9':''.join(`i`+w[i<2]+',\n'+`i`+b[i<2]+'.\n'+t+(`i`if i>1 else'No')+w[0]+'.\n'for i in range(1,100)[::-1])+'No'+w[0]+',\nNo'+b[0]+'.\n'+'Go to the store, buy some more,\n99'+w[0]+'.'}
for d in q:
 if d in c:print c[d]

Try it online!
Bleh. It was already bleh, but then I discovered a bug that cost me a byte to fix. Bleh.
Saved some characters by not exiting on invalid input like I thought you were supposed to.
Explained version coming shortly. I gave up. I barely even understand how this monstrosity works any more. If there's demand I'll give it another go but until then it's not happening.

You don't exit on the invalid character, just display the message, so you can save 7 chars there.

@KyleKanos Oh, I misunderstood that. Thanks!

Your lyrics aren't right- currently it says:
99 bottles of beer on the wall,   99 bottles of beer.   Take one down, pass it around,   *99* bottles of beer on the wall.
It's supposed to say:
99 bottles of beer on the wall,   99 bottles of beer.   Take one down, pass it around,   *98* bottles of beer on the wall.

It also gives an error when I enter +. You're supposed to ignore +, not give an error

Also there's not supposed to be anything between outputs. Like if I enter HQHH it should say Hello World!HQHHHelloWorld!Hello World!

J - 444 bytes
I liked the number, so stopped golfing. Here 'ya go, single expression function!
f=:'Source code contains invalid characters'"_`('Hello, world!'"_`[`((((s=:(<:@[s],L,(v,LF,'Take one down and pass it around, '"_,b@<:,' of beer on the wall.'"_)@[,''"_)`(],(L=:LF,LF),(v=:1&b,' of beer on the wall, '"_,b,' of beer.'"_)@[)@.([<1:))''"_),LF,'Go to the store and buy some more, '"_,(b=:({&'Nn'@([=0:),'o more'"_)`(":@])@.(]>0:),{.&' bottles'@(8:-=&1@])),' of beer on the wall.'"_)@(99"_))`]@.('HQ9+'&i.@])"0 1 0])@.(*./@e.&'HQ9+')

Examples:
   hq9 '9QHHQ+'
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.

98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.

...

3 bottles of beer on the wall, 3 bottles of beer.
Take one down and pass it around, 2 bottles of beer on the wall.

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
9QHHQ+
Hello, world!
Hello, world!
9QHHQ+
+
   hq9 '9QHHaQ'
Source code contains invalid characters

And no, I won't write an explanation for this. Too long.

Wait, why is this downvoted?

Perl, 325 - 8 = 317
sub p{print@_}$_=<>;$a=' on the wall';$b=' bottle';$e=' of beer';$c='Take one down, pass it around';if(!/^[hqHQ9+]+$/){p"Source code contains invalid characters";exit}$k=$_;for(/./g){/H|h/&&p"Hello, World!";if(/9/){$i=99;$d=$b."s$e";while($i>0){p"$i$d$a
$i$d
$c
";$q=--$i==1?'':'s';$d="$b$q$e";$i||=No;p"$i$d$a
"}}/Q|q/&&p$k}

Expanded:
sub p{print@_}
$_=<>;
$a=' on the wall';
$b=' bottle';
$e=' of beer';
$c='Take one down, pass it around';
if(!/^[hqHQ9+]+$/){
    p"Source code contains invalid characters";
    exit
}
$k=$_;
for(/./g){
    /H|h/&&p"Hello, World!";
    if(/9/){
        $i=99;
        $d=$b."s$e";
        while($i>0){
            p"$i$d$a
$i$d
$c
";
            $q=--$i==1?'':'s';
            $d="$b$q$e";
            $i||=No;
            p"$i$d$a
"
        }
    }
    /Q|q/&&p$k
}

Ruby, 364 360 - 8 = 352
Still has lots of room for improvement. 99 bottles code stolen from here.
p=gets.upcase
if p=~/[^HQ9+
]/
puts"Source code contains invalid characters"else
p.each_char{|x|case x
when ?H
puts"Hello, world!"
when ?Q
puts p
when ?9
def c;"#{$n} bottle#{'s'if$n>1} of beer on the wall"end
($n=99).times{puts"#{c}, #{c[0..-13]}.
#{$n<2?"Go to the store and buy some more":"Take one down and pass it around"}, #{$n=($n-2)%99+1;c}.

"}end}end

There's supposed to be No more bottles of beer on the wall after the 1 bottle section. then it's Go to the store...

1 bottle of beer on the wall, 1 bottle of beer on the wall, take one down, pass it around, no more bottles of beer on the wall.                                                      No more bottles of beer on the wall, no more bottles of beer, go to the store, buy some more, 99 bottles of beer on the wall.

@Oliver The question does not specify the exact lyrics of the song. In no place does it require the "no more" section to be included.

Ok, but also, there's not supposed to be a newline between outputs.

@Oliver Where does the challenge say that?

Well, ProgramFOX said that to me.

Python 2, 340 - 8 = 332
s,o=raw_input(),''
for z in s:
 if z in'Hh':o+='Hello World!'
 elif z in'Qq':o+=s
 elif'9'==z:
  i=298
  while~-i:print i/3or 99,'bottle'+'s of beer on the wall.\n'[2<i<6:9+i%3*12]+'..\nGToa kteo  otnhee  dsotwonr,e ,p absusy  isto maer omuonrde,,'[(i>3)+i%3*68::2];i-=1
 elif'+'!=z:o='Source code contains invalid characters';break
print o

Haskell, 298
main=interact g
g s|all(`elem`"HQ9+")s=s>>=(%s)|0<1="Source code contains invalid characters"
'H'%_="hello World!"
'Q'%s=s
'9'%_=drop 32$d 99
_%_=""
k=" bottles of beer on the wall"
d 0="No more"++k++"."
d n|a<-shows n k=[a,".\n\n",a,",\n",take 18a,".\ntake one down, pass it around\n",d$n-1]>>=id

this is quite straightforward. % returns a command's output (given the source cod for use on Q). d returns the 99 bottles song with a junk line at the start for golfing reasons.
everything is wrapped in an interact (you might want to use g instead of main when testing)

How should I run it? I tried pasting it in WinGHCi, but I get <interactive>:8:5: parse error on input ‘=’.

@ProgramFOX i have no idea... Ill check when i can

@ProgramFOX sorry it took long :-). you're not using GHCi properly. in GHCi you can't irectly input definitions as it expects expressions. you can either use a let to insert definitions (this breaks when inserting multiple definitions not separated by ;) or run the code from a file.

I see. I still fail at trying to run it though; when I load the file and call main, it says that the source code contains invalid characters when I try to execute H. When I try to run g instead of main, it immediately gives an error.

@ProgramFOX main doesn't work because the newline appended is not a legal command. That's why i recommended  using g instead. As for g, does putStrLn $ g "H"  not work properly?

That works indeed. I was using the wrong way to execute the HQ9+ commands. Thanks for explaining me!

Tcl, 515
set d [read stdin]
if {![regexp {^[hq9\+HQ]*$} $d]} {puts "Source code contains invalid characters"}
lmap c [split $d {}] {set b { bottles of beer}
switch -- $c H {puts "Hello, world"} Q {puts $d} 9 {for {set i 99} {$i>2} {incr i -1} {puts "$i$b on the wall,
$i$b.
Take one down, pass it around,
[expr $i-1]$b on the wall.
"}
puts "2$b on the wall,
2$b.
Take one down, pass it around,
1 bottle of beer on the wall.

1 bottle of beer on the wall,
1 bottle of beer.
Take one down, pass it around,
No$b on the wall."}}

Just a bit golfed, still smaller than C and the correct 99 Bottles of beer end verse.

Okay, now that one's legit. Good job, you beat me. I should stop using C for golf.

You can remove the first line and embed it at the last parameter of regexp. You can get my golfing of 99 beers on https://codegolf.stackexchange.com/a/109818/29325

JavaScript (ES6), 385
s=>{n=99,b=' bottle',j=' of beer',d=' on the wall',e='Take one down, pass it around',k='Go to the store, buy some more',l='No',o='s',f=', ';for(i=s.split(m=v='');~n;)v+=[n||l,b,n-1?o:m,j,d,f,n||l,b,n-1?o:m,j,f,n?e:k,f,--n<1?99:n,b,n-1?o:m,j,d,'! '].join(m);return s.match(/[^HQ9\+]/,r='')?'Source code contains invalid characters':[...s].map(c=>({H:'Hello World!',9:v,Q:s})[c]).join``}

Didn't opt for the case-insensitive, would have cost too many characters. Not even close to some of the other entries, but was fun nonetheless!
JavaScript, 344
I made a version with a less complete version of the song:
(function(i){if(s.match(/[^HQ9\+]/)){m='Source code contains invalid characters'}else{n=99,b=' bottles of beer ',d='on the wall',e='take one down, pass it around',f=', ';for(;n;)v+=[n,b,d,f,n,b,f,e,f,--n||'no more',b,d,'! '].join(m);h={H:'Hello World!',Q:arguments.callee+m,9:v};for(;c=i[n++];)m+=h[c]||''}alert(m)})((s=prompt()).split(m=v=''))

but after seeing the other entries (and looking at the actual lyrics, who knew!), I thought it was a bit of a cop out!

It should be Go to the store, buy some more, *99* bottles of beer on the wall, not *No more* bottles of beer on the wall

If you buy some more, how can there still be no more?

And also, Q doesn't work for me.

@Oliver didn't notice you comment on this back then... I totally misunderstood when the Q was supposed to do that the time and provided the source code of the function instead of the input... That was originally my reason for doing it in JS, that part would be easy, however I now know that isn't what's required at all!

@Oliver updated the lyrics!

Julia, 362
s = chomp(readline(STDIN))
l=""
z=" of beer"
q,r,w,t=" bottles$z"," bottle$z"," on the wall.\n","take one down, pass it around,\n"
for j=99:-1:2
b="$j$q"
l*="$b$w$b.\n$t"
end
l*="1$r$(w)1$r.\n$(t)No$q$w"
p=println
all(c->c in "HQ9+", s)||p("Source code contains invalid characters")
for c in s
    c=='Q'&&p(s)
    c=='H'&&p("Hello, world!")
    c=='9'&&p(l)
end

Lua 443 - 8 = 435 464 - 8 = 456
I managed to save 21 characters by using multiple if-ends instead of if-elseif-end. I also had some extra white spaces floating around after a few ).
p=print o=" of beer"t=" on the wall"B=" bottle"b=" bottles"l=io.read("*l");g=l:lower()if g:match"[^hq9+]"then p("Source code contains invalid characters")end for i=1,#g do s=g:sub(i,i)if s=='h'then p("Hello, world")end if s=='q'then p(l)end if s=='9'then n=99 repeat p(n..b..o..t..", "..n..b..o)n=n-1 p("Take one down, pass it around, "..n..b..o..t..".")p()until n==1 p("1"..B..o..t..", 1"..B..o)p("No more"..b..o..t..", no more"..b..o)end end

I'm fairly happy with this one, even though it's not much shorter than my Fortran answer. The 99 bottles of beer code has been modified from this answer by Alessandro. Ungolfed, we have
-- reuse stuff
p=print
o=" of beer"
t=" on the wall"
B=" bottle"
b=" bottles"
-- read the line & then lowercase it for case insensitivity
l=io.read("*l");g=l:lower()
if g:match"[^hq9+]" then -- horray for basic regex
   p("Source code contains invalid characters")
end
for i=1,#g do
   s=g:sub(i,i)               -- take substring
   if s=='h' then p("Hello, world") end
   if s=='q' then p(l) end
   if s=='9' then
      n=99
      repeat
         p(n..b..o..t..", "..n..b..o)
         n=n-1
         p("Take one down, pass it around, "..n..b..o..t..".")
         p()
      until n==1
      p("1"..B..o..t..", 1"..B..o)
      p("No more"..b..o..t..", no more"..b..o)
   end
end

The code to lowercase the input costs 12 characters, so the bonus is not worth it.

You don't need to lowercase the input, you can just do something like if s in'Hh'

It saves 8 chars

@MCParadox: Er, that's Python you're thinking of, Lua's in is for for-loop iterators and not comparisons; you'll get an error if you stick that in there. There are three choices here: (1) use match at each line, (2) user s=='h'or s=='H' at each line, (3) do it the way I did it. Clearly (3) is shorter than (1) and (2).

Java, 546 bytes
This is my first code golf submission. I am sure we could do more with it. It reads the input as the command line argument.
Beer code "borrowed" from "99 Bottles of Beer" java answer (creative commons)
class a{public static void main(String[] a){if(a[0].matches("^[HQ9\\Q+\\E]+$")){for(char c:a[0].toCharArray()){if(c=='H')p("Hello, world!");if(c=='Q')p(a[0]);if(c=='9')b();}}else{System.out.println("Source code contains invalid characters");}}static void p(String s){System.out.println(s);}static void b(){String b=" of beer",c=" on the wall",n=".\n",s;for(int i=100;i-->1;){s=" bottle"+(i>1?"s":"");p(i+s+b+c+", "+i+s+b+n+(i<2?"Go to the store and buy some more, 99":"Take one down and pass it around, "+(i-1))+" bottle"+(i!=2?"s":"")+b+c+n);}}}

Let me know if command line args is not acceptable.
This was a lot of fun!

CLA are fine.  Nice answer.

C, 562 bytes
char*c="%1d %3$s of %4$s on the %5$s, %1d %3$s of %4$s.\n\0Take one down and pass it around, %2d %3$s of %4$s on the %5$s.\n\0Go to the store and buy some more, %1d %3$s of %4$s on the %5$s.\n";main(int a,char**b){int x=0;for(int i=0;i<strlen(b[1]);i++){if(b[1][i]=='+')x++;else if(b[1][i]=='9'){int k=99;while(1){printf(&c[0],k,k,k==1?"bottle":"bottles","beer","wall");if(k!=1){printf(&c[49],k,k,"bottles","beer","wall");k--;}else{k=99;printf(&c[114],k,k,"bottles","beer","wall");break;}}}else printf("%s",b[1][i]=='H'?"Hello, world!":(b[1][i]=='Q'?b[1]:""));}}

As a full program. First argument is the HQ9+ program. With an actual accumulator. I challanged myself not to use define statements.
Ungolfed version:
char* c = "%1d %3$s of %4$s on the %5$s, %1d %3$s of %4$s.\n\0Take one down and pass it around, %2d %3$s of %4$s on the %5$s.\n\0Go to the store and buy some more, %1d %3$s of %4$s on the %5$s.\n";
main (int a, char** b) {
    int x = 0;
    for (int i = 0; i < strlen(b[1]); i++) {
        if (b[1][i] == '+')
            x++;
        else if (b[1][i] == '9') {
            int k = 99;
            while (1) {
                printf(&c[0], k, k, k == 1 ? "bottle" : "bottles", "beer", "wall");
                if (k != 1) {
                    printf(&c[49], k, k, "bottles", "beer", "wall");
                    k--;
                } else {
                    k=99;
                    printf(&c[114], k, k, "bottles", "beer", "wall");
                    break;
                }
            }
        } else
            printf("%s",b[1][i] == 'H' ? "Hello, world!" : (b[1][i] == 'Q' ? b[1] : ""));
    }
}

437 bytes

GNU C, 429 423 bytes
Compiles and runs correctly on GCC-8.3, without any compiler flags. No other configuration was tested.
It considers a file to be a stream of text up to the first '\n' that it encounters (this just makes testing easier, can be fixed by replacing the 10 in (c=getchar())!=10 with a -1). However, keep in mind that newlines will not be considered valid.
char*b="bottles of beer\0on the wall\0Take one down, pass it around",s[4096];n;Q(){puts(s);}W(){puts("Hello, world!");}B(){for(n=100;--n;){printf("%d %s %s,\n%d %s.\n%s,\n%d %s %s.\n\n",n,b,b+16,n,b,b+28,n-1,b,b+16);}}N(){}l=0,c,i,(*t[])()={[43]=N,[57]=B,[72]=W,[81]=Q};main(){while((c=getchar())!=10){if(c!=43&&c!=57&&c!=72&&c!=81){exit(puts("Source code contains invalid characters"));}s[l++]=c;}for(;i<l;++i)t[s[i]]();}

Degolfed
// we stick all the strings in a single string, null separated.
// We will later index into the right indices to print the right pieces.
char*b="bottles of beer\0on the wall\0Take one down, pass it around";

// Here we store the source code. I chose 4kiB, but this was rather arbitrary.
char s[4096];

// n is the counter for the B function
n;

Q() { // Q for quine
    // puts is shorter than printf and it prints a newline for free
    puts(s);
}

W() { // W for world
    puts("Hello, world!");
}

B() { // B for bottles
    // n is the current count
    for (n = 100; --n;) {
        printf("%d %s %s,\n"    // n bottles of beer on the wall,
               "%d %s.\n"       // n bottles of beer.
               "%s,\n"          // Take one down, pass it around,
               "%d %s %s.\n\n", // n-1 bottles of beer on the wall

               n, b, b + 16, // Index into the right positions
               n, b,         // in the string.
               b + 28, n - 1, b, b + 16);
    }
}

N() {} // N for nothing, we need it for the table

// l is the length of source code
// c is the currently read character
// i is an index
l = 0, c, i;

// This array of function pointers is a bit like a jump table.
// This table tells us which function to call depending on the current char.
// It is essentially a hand-rolled switch statement, but shorter.
// NOTE: the [index]=value syntax is a GNU extension
int(*t[])()={
    [43/* ASCII + */] = N, // do nothing
    [57/* ASCII 9 */] = B, // print 99 bottles
    [72/* ASCII H */] = W, // print hello world
    [81/* ASCII Q */] = Q  // print source
};

main() {
    // consume input until we hit \n. this
    while ((c = getchar()) != 10) {
        // if we find a character not in "HQ9+", we log and exit
        if (c != 43 && c != 57 && c != 72 && c != 81) {
            exit(puts("Source code contains invalid characters"));
        }
        // populate the source code
        s[l++] = c;
    }

    // go over the source code (at this point validated)
    // and call the function that is set in the table
    // We can skip initializing i because it is a static, and statics
    // get implicitly initialized to 0. this saves 3 bytes
    for (; i < l; ++i)
        t[s[i]]();
}

I will admit I cheated a bit with the 99 bottles.

399 bytes

Excel VBA, 489 Bytes
Unindented:
Sub h(s)
For c=1 To Len(s)
Select Case Mid(s,c,1)
Case "H"
Debug.? "Hello,World!"
Case "Q"
Set v=ActiveWorkbook.VBProject.VBComponents("M").CodeModule:For n=1 To v.countoflines:Debug.? v.Lines(n,1):Next
Case "+"
a=a+1
Case "9"
s=" Bottles of Beer":o=" Bottle of Beer":w=" on the wall":t=". Take 1 down pass it around,":p=",":d=".":For n=99 To 3 Step -1:Debug.? n;s;w;p;n;s;t;n-1;s;w;d:Next:Debug.? 2;s;w;p;2;s;t;1;o;w;d:Debug.? 1;o;w;p;1;o;t;"No";s;w;d
End Select
Next
End Sub

(indented for readability)
Sub h(s)
For c=1 To Len(s)
Select Case Mid(s,c,1)
    Case "H"
        Debug.? "Hello,World!"
    Case "Q"
        Set v=ActiveWorkbook.VBProject.VBComponents("M").CodeModule
        For n=1 To v.countoflines
            Debug.? v.Lines(n,1)
        Next
    Case "+"
        a=a+1
    Case "9"
        s=" Bottles of Beer"
        o=" Bottle of Beer"
        w=" on the wall"
        t=". Take 1 down pass it around,"
        p=","
        d="."
        For n=99 To 3 Step -1
            Debug.? n;s;w;p;n;s;t;n-1;s;w;d
        Next
        Debug.? 2;s;w;p;2;s;t;1;o;w;d
        Debug.? 1;o;w;p;1;o;t;"No";s;w;d
End Select
Next
End Sub

Rename default Module1 to M
call with h "+++++++++Your Code"
This will also work on other office applications, changing ActiveWorkbook to the appropriate document type

note that excel will add spaces, and expand abbreviations, so within excel, the code is 531 chars

Thats 636 Characters

Remove all the whitespace from my indentation, @oliver

You can loose 3 Bytes by converting all instances of For n=1 To to For n=1To (removing whitespace before To) and 4 bytes by converting all instances of Debug.? 2; to Debug.?2; (removing whitespace after ? keyword)


text:
Bitonic Program to find the maximum of two numbers
A bitonic program is a program every string of which is bitonic.
A bitonic string is a string S with S[0]<= . . . <=S[k]>= . . . >=S[n-1] for some k, 0<=k< n. (n is the length of the string)
Examples of Bitonic strings:

abcd
dcba
vyzcba
adgf

The goal is to write the shortest bitonic program to find the maximum of two numbers.
Note:

Two group of characters separated by one or more spaces(' '), tabs('\t'), backspaces or line-break('\n') are considered as two different strings.
Comments in the code are not allowed.
Other than tabs, spaces, backspaces or line-breaks, the code must contain at least 3 other characters.

EDIT:

Inbuilt function not allowed.
Conditional statements not allowed.
<(less than) and >(greater than) signs not allowed

so... do we choose k? for every string? where does k come from? examples of bitonic strings? this problem is really unclear.

@Doorknob added the examples.

@all: Got downvotes!! Forgot to add some conditions. Please update your codes

uhh... no. Your edit doesn't make sense. Point one: what exactly counts as inbuilt? Pretty much any printing function is built-in. Also, why block conditional statements? Also, do for-each loops count as conditional statements? If < and > are not allowed, are gt and lt? Or are we forced to do comparison via subtraction and checking the sign? In Assembly, does that mean that CMP is not allowed while SUB is, even if their only difference is that the former doesn't write back? Are we allowed to use < and > for other things than comparison (say, bit shift or IO)?

And no, "please update your codes" doesn't work like that. Please use the sandbox the next time, and don't go invalidating existing solutions by introducing extra unreasonable restrictions because you "forgot" them. These are not loopholes you forgot to patch. These are game changers. Voting to close.

@JanDvorak perfectly fine. This will teach me some lesson.

This question appears to be off-topic because it is a chameleon question.

APL, 3
⎕⌈⎕

Can this be beaten?

Too bad two of the three characters don't display for me (unless they're meant to be rectangles). Can you give out a textual description?

@JanDvorak They ARE rectangles (image)