问:
0.0000000000000000001
Notice the pattern in the below sequence:

```<code>0.1, 0.01, 0.001, 0.0001, 0.00001 and so on, until reaching 0.{one hundred zeros}1
</code>```

Then, continued:

```<code>0.2, 0.02, 0.002, 0.0002, 0.00002 and so on, until reaching 0.{two hundred zeros}2
</code>```

Continued:

```<code>0.3, 0.03, etc, until 0.{three hundred zeros}3
</code>```

Continued:

```<code>0.4, 0.04, etc, until 0.{four hundred zeros}4
</code>```

Sped up a bit:

```<code>0.10, 0.010, etc.  until 0.{one thousand zeros}10
</code>```

Sped up some more:

0.100, 0.0100...

You get the idea.

The input your code will receive is an integer, the number of terms, and the output is that many number of terms of the sequence.

Input and output formats are unrestricted, and separators are not required.

Trailing zeros are necessary.

Standard loopholes apply.

The outputs of some nth terms are given below:

```<code>nth term -> number
-------------------
1        -> 0.1
102      -> 0.2
303      -> 0.3
604      -> 0.4
1005     -> 0.5
1506     -> 0.6
2107     -> 0.7
2808     -> 0.8
3609     -> 0.9
4510     -> 0.10
</code>```

答:
05AB1E, 23 bytes

Online compiler can't show all terms for high N but it works fine offline.

```<code>Lvy2°*>F„0.0N×yJ,¼¾¹Qiq
</code>```

Explanation

```<code>                          # implicit input X
Lv                        # for each y in range [1 .. X]
  y2°*>F                  # for each N in range [0 .. y*100+1)
        „0.               # push the string "0."
           0N×            # push 0 repeated N times
              y           # push current y
               J,         # join and print
                 ¼¾¹Qiq   # quit the program after X terms printed
</code>```

Try it online!

Title: 0.0000000000000000001

Body:
05AB1E, 23 bytes

Online compiler can't show all terms for high N but it works fine offline.

Lvy2°*>F„0.0N×yJ,¼¾¹Qiq

Explanation

                          # implicit input X
Lv                        # for each y in range [1 .. X]
  y2°*>F                  # for each N in range [0 .. y*100+1)
        „0.               # push the string "0."
           0N×            # push 0 repeated N times
              y           # push current y
               J,         # join and print
                 ¼¾¹Qiq   # quit the program after X terms printed

Try it online!


ContentLicense: CC BY-SA 3.0

Title: 0.0000000000000000001

Body:
Notice the pattern in the below sequence:

```<code>0.1, 0.01, 0.001, 0.0001, 0.00001 and so on, until reaching 0.{one hundred zeros}1
</code>```

Then, continued:

```<code>0.2, 0.02, 0.002, 0.0002, 0.00002 and so on, until reaching 0.{two hundred zeros}2
</code>```

Continued:

```<code>0.3, 0.03, etc, until 0.{three hundred zeros}3
</code>```

Continued:

```<code>0.4, 0.04, etc, until 0.{four hundred zeros}4
</code>```

Sped up a bit:

```<code>0.10, 0.010, etc.  until 0.{one thousand zeros}10
</code>```

Sped up some more:

0.100, 0.0100...

You get the idea.

The input your code will receive is an integer, the number of terms, and the output is that many number of terms of the sequence.

Input and output formats are unrestricted, and separators are not required.

Trailing zeros are necessary.

Standard loopholes apply.

The outputs of some nth terms are given below:

```<code>nth term -> number
-------------------
1        -> 0.1
102      -> 0.2
303      -> 0.3
604      -> 0.4
1005     -> 0.5
1506     -> 0.6
2107     -> 0.7
2808     -> 0.8
3609     -> 0.9
4510     -> 0.10
</code>```

Body:
PHP, 83 Bytes

for($s=1;$i++<$argv[1];){if($r>100*$s){$s++;$r=0;}echo" 0.".str_repeat(0,$r++).$s;}


问:
When was this language released?
Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that it must be written in as many different languages as possible.

Your score is the total number of different years that are correctly printed.

For each language you use, you must

Specify which version of the language you are using. (If there are multiple versions)

Specify what year that version was first released, and

Provide a link to a page proving the date of your version/language.

Any one of these counts as release date proof, as long as it specifies the version number (if applicable) and a release date.

A wikipedia page.

An esolangs page.

The language's official website. A github page or similar counts, as long as it has a release date. (Latest commit does not count, unless there is a version number somewhere in the code)

If there are not multiple versions or releases of a language, just use the initial release date of the language.

Minor versions of the same language do count as different languages, as long as they come from different years and still produce the correct output. You may not use any builtins that give you information (including release date) about the current version of the language you are using. For example, this is an invalid python submission:

```<code>import platform
i = platform.python_version()
if i == '3.5':
    print(2015)
if i == '3.4':
    print(2014)
if i == '3.3':
    print(2012)
...
</code>```

Whichever submission correctly prints the most distinct years wins!

Rules

Each program must print out the language year and nothing more. A trailing newline (windows style or *nix style) is allowed.

No programs may take any input.

In case of a tie, the shortest code scored in bytes wins. You may use whatever encoding you like for this, but all programs must use the same encoding.

Any of the programs may print to STDERR, or throw runtime/compile time errors and warnings as long as the correct output is still printed to STDOUT or a file.

Different languages may use different IO methods, but they most all be full programs, (functions not allowed for this challenge) and follow one of our default IO methods allowed.

Happy <s>golfing</s> polyglotting!

答:
3 years, 89 bytes

Python 2, JavaScript (ES6) and Perl

```<code>eval((["1","print=_=>console.log(1995)"])[+(2/3>0)]);print(eval(("1991",1987)["$$">"0"]))
</code>```

The first eval will run 1 on Python 2 and print=_=>console.log(1995) on JavaScript and Perl using the integer division feature of Python 2. This creates a print function in JavaScript and Perl only silently cares about the syntax errors and carries on regardless.

The second eval relies on Perl interpolating the variable $$ (current PID) into the string, which will be true when compared (using the > operator) against "0" (Python requires a string in that comparison whereas Perl implicitly converts to integer).

I could have shoe-horned in more languages, but wanted to have a solution that didn't abuse comments and only worked in 'regular' languages.

I used this Wikipedia page to retrieve the years to use.

Title: When was this language released?

Body:
3 years, 89 bytes

Python 2, JavaScript (ES6) and Perl

eval((["1","print=_=>console.log(1995)"])[+(2/3>0)]);print(eval(("1991",1987)["$$">"0"]))

The first eval will run 1 on Python 2 and print=_=>console.log(1995) on JavaScript and Perl using the integer division feature of Python 2. This creates a print function in JavaScript and Perl only silently cares about the syntax errors and carries on regardless.

The second eval relies on Perl interpolating the variable $$ (current PID) into the string, which will be true when compared (using the > operator) against "0" (Python requires a string in that comparison whereas Perl implicitly converts to integer).

I could have shoe-horned in more languages, but wanted to have a solution that didn't abuse comments and only worked in 'regular' languages.

I used this Wikipedia page to retrieve the years to use.


问:
Multiple-Key Sorting
Given a list of indices and zero or more lists of integers, output the lists of integers, sorted in ascending order, with the key priority from the first input.

Example

Let the keys input be [1, 0, 2], and the lists input be [[5, 3, 4], [6, 2, 1], [5, 2, 1]]. Those lists need to be sorted by their second element, then first element, then third element, in ascending order:

First, we sort by the values at index 1: [[6, 2, 1], [5, 2, 1], [5, 3, 4]]

Next, we break any ties from the first sort using the values at index 0: [[5, 2, 1], [6, 2, 1], [5, 3, 4]]

Finally, we break any remaining ties with the vlues at index 2 (this doesn't actually change anything, because there are no ties remaining).

Details

Sorting is stable: if two elements compare equal with respect to the given sort keys, they must remain in the same relative order in the output. For example, if A and B are equal under the given sort keys, and the input was [..., A, ..., B, ...], A must be placed before B in the output.

A sort key will never reference a non-existant element in one of the input lists.

No sort key will be repeated. Thus, [1, 2, 1] is not a valid list of sort keys.

Any elements not referenced by the sort keys do not factor into the sorting order. Only the initial relative order and the values of the elements referenced by the sort keys determine the output order.

You may choose whether the sort keys are zero-indexed or one-indexed.

There will be no negative values in the sort keys. If you choose to use one-indexing, there will be no zeroes in the sort keys either.

Integer values will not exceed your language's natively-representable range. If your chosen language is natively capable of arbitrary-precision integers (like Python), then any integer value can be present in the input, subject to memory constraints.

Reference Implementation (Python 2)

#!/usr/bin/env python

keys = input()
lists = input()

print sorted(lists, key=lambda l:[l[x] for x in keys])
```
<p>Try it online</p>
<h2>Test Cases</h2>
<p>Format: <code>keys lists -> output</code>. All sort keys are zero-indexed.</p>
```[1, 0, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[5, 2, 1], [6, 2, 1], [5, 3, 4]]
[1, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[6, 2, 1], [5, 2, 1], [5, 3, 4]]
[0, 1] [[1, 2], [2, 1]] -> [[1, 2], [2, 1]]
[1, 0] [[1, 2], [2, 1]] -> [[2, 1], [1, 2]]
[0] [[4], [10, 11, -88], [-2, 7]] -> [[-2, 7], [4], [10, 11, -88]]
[2] [[-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6]] -> [[-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2]]
[2, 1] [[9, 2, -2, -10, -6], [3, -4, -2]] -> [[3, -4, -2], [9, 2, -2, -10, -6]]
[2, 4, 8] [[5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5], [-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3]] -> [[-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3], [5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5]]
[1, 2, 3, 4, 5] [[-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [5, 3, -6, -5, -4, -4, -8, 2], [9, -4, 1, -1, -3, -2], [-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [1, -5, -3, -10, -7, 9, -8, -5, -1], [-9, 4, -1, -1, 2, 4]] -> [[-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -5, -3, -10, -7, 9, -8, -5, -1], [9, -4, 1, -1, -3, -2], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [5, 3, -6, -5, -4, -4, -8, 2], [-9, 4, -1, -1, 2, 4]]
[8, 7, 3, 2, 4, 9, 1] [[8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9]] -> [[10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5]]
```

答:
CJam (12 bytes)

```<code>{{1$\f=}$\;}
</code>```

Online demo. This is an anonymous block (function) which takes the arguments in the order given for the test cases and leaves the sorted value on the stack. It relies on the built-in sort $ being stable, but the official interpreter guarantees that.

Dissection

```<code>{          e# Define a block. Stack: orders values-to-sort
  {        e#   Sort by...
    1$\f=  e#     Copy orders from the stack, and map array lookup
  }$
  \;       e#   Pop the orders to leave just sorted-values
}
</code>```

Title: Multiple-Key Sorting


问:
Yes, of course I'm an adult!
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

答:
Java, 95 bytes

```<code>void p(double d){if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:(int)d);}
</code>```

5 worse than Kevin's answer, but it has the print statement inside the function so maybe I get some pity points for that.

If this is allowed in Java, you could also use

```<code>d->{if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:d);};
</code>```

Which could be used like

```<code>Consumer<Double> func = d->{if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:d);};
</code>```

Title: Yes, of course I'm an adult!

Body:
Java, 95 bytes

void p(double d){if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:(int)d);}

5 worse than Kevin's answer, but it has the print statement inside the function so maybe I get some pity points for that.

If this is allowed in Java, you could also use

d->{if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:d);};

Which could be used like

Consumer<Double> func = d->{if(d%1>0)System.out.print(d<1.4?1.4:d);else System.out.print(d<18?18:d);};


问:
Unlucky Numbers!

Things to know:

First, lucky numbers.

Lucky numbers are generated like so:

Take all the natural numbers:

```<code>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20...
</code>```

Then, remove each second number.

```<code>1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39...
</code>```

Now, 3 is safe.

Remove every 3rd number:

```<code>1, 3, 7, 9, 13, 15, 19, 21, 25, 27, 31, 33, 37, 39, 43, 45, 49, 51, 55, 59...
</code>```

Now, 7 is safe.

Remove every 7th number.

Continue, and remove every nth number, where n is the first safe number after an elimination.

The final list of safe numbers is the lucky numbers.

The unlucky numbers is composed of separate lists of numbers, which are [U1, U2, U3... Un].

U1 is the first set of numbers removed from the lucky "candidates", so they are:

```<code>2, 4, 6, 8, 10, 12, 14, 16, 18, 20...
</code>```

U2 is the second set of numbers removed:

```<code>5, 11, 17, 23, 29, 35, 41, 47, 53, 59...
</code>```

And so on and so forth (U3 is the third list, U4 is the fourth, etc.)

Challenge:

Your task is, when given two inputs m and n, generate the mth number in the list Un.

Example inputs and outputs:

```<code>(5, 2) -> 29
(10, 1) -> 20
</code>```

Specs:

Your program must work for m up to 1e6, and n up to 100.

You are guaranteed that both m and n are positive integers.

If you're curious, U(1e6, 100) = 5,333,213,163. (Thank you @pacholik!)

Your program must compute that within 1 day on a reasonable modern computer.

This is code-golf, so shortest code in bytes wins!

PS: It would be nice if someone came up with a general formula for generating these. If you do have a formula, please put it in your answer!

答:
R 82 bytes

```<code>f<-function(m,n){a=1:2e8
i=1
while(i<n){a=c(0,a)[c(F,rep(T,i))]
i=i+1}
a[(n+1)*m]}
</code>```

Usage

```<code>f(5,2)
Returns 29
</code>```

This needs to have a large enough vector to start with so there are enough numbers left to return the value. The vector created is already about 800Mb and the function can handle upto m=1e4 and n=100 so still well short of the goal.

To create a large enough vector to calculate f(1e6,100) would take a starting vector of 1:2e10.  Due to Rs data allocation procedures this creates a vector >70Gb which can't be run on any computer I know although the code would run.

```<code>Error: cannot allocate vector of size 74.5 Gb
</code>```

For reference f(1e4,100) runs in about in about 30 seconds.  Based on this and a couple smaller tests f(1e6,100) would take about an hour.

Title: Unlucky Numbers!

Body:
R 82 bytes

f<-function(m,n){a=1:2e8
i=1
while(i<n){a=c(0,a)[c(F,rep(T,i))]
i=i+1}
a[(n+1)*m]}

Usage

f(5,2)
Returns 29

This needs to have a large enough vector to start with so there are enough numbers left to return the value. The vector created is already about 800Mb and the function can handle upto m=1e4 and n=100 so still well short of the goal.

To create a large enough vector to calculate f(1e6,100) would take a starting vector of 1:2e10.  Due to Rs data allocation procedures this creates a vector >70Gb which can't be run on any computer I know although the code would run.

Error: cannot allocate vector of size 74.5 Gb

For reference f(1e4,100) runs in about in about 30 seconds.  Based on this and a couple smaller tests f(1e6,100) would take about an hour.


答:
PowerShell v2+, 89 bytes

```<code>param($n)for($j=1;;$j++){for($i=0;$i-le100*$j;$i++){"0.$('0'*$i)$j";if(++$k-ge$n){exit}}}
</code>```

Straight-up double-for loop. The first, for $j is infinite. The inner, for $i, loops from 0 up to 100*$j, using string concatenation and string multiplication to print out the appropriate item. It also checks total loop counter $k against input $n, and exits the program after we hit that point.

Title: 0.0000000000000000001

Body:
PowerShell v2+, 89 bytes

param($n)for($j=1;;$j++){for($i=0;$i-le100*$j;$i++){"0.$('0'*$i)$j";if(++$k-ge$n){exit}}}

Straight-up double-for loop. The first, for $j is infinite. The inner, for $i, loops from 0 up to 100*$j, using string concatenation and string multiplication to print out the appropriate item. It also checks total loop counter $k against input $n, and exits the program after we hit that point.


答:
Haskell, <s>53</s> 63 bytes

This does the same thing as the 05AB1E answer now

```<code>f=(`take`["0."++('0'<$[1..y])++show x|x<-[1..],y<-[0..x*100]])
</code>```

Title: 0.0000000000000000001

Body:
Haskell, <s>53</s> 63 bytes

This does the same thing as the 05AB1E answer now

f=(`take`["0."++('0'<$[1..y])++show x|x<-[1..],y<-[0..x*100]])


答:
Pyth, <s>5</s> 4 bytes

```<code>@LDF
</code>```

Try it online: Demonstration or Test Suite

Thanks to @Maltysen for one byte.

Explanation:

```<code>@LDFQ   Q (=input) added implicitly.
  D     sort a list of lists by
@L         the sublists generated by some indices
   FQ   executes ^ with the the input as parameter
</code>```

I was really surprised that this worked. It's a really strange syntax.

Title: Multiple-Key Sorting

Body:
Given a list of indices and zero or more lists of integers, output the lists of integers, sorted in ascending order, with the key priority from the first input.

Example

Let the keys input be [1, 0, 2], and the lists input be [[5, 3, 4], [6, 2, 1], [5, 2, 1]]. Those lists need to be sorted by their second element, then first element, then third element, in ascending order:

First, we sort by the values at index 1: [[6, 2, 1], [5, 2, 1], [5, 3, 4]]

Next, we break any ties from the first sort using the values at index 0: [[5, 2, 1], [6, 2, 1], [5, 3, 4]]

Finally, we break any remaining ties with the vlues at index 2 (this doesn't actually change anything, because there are no ties remaining).

Details

Sorting is stable: if two elements compare equal with respect to the given sort keys, they must remain in the same relative order in the output. For example, if A and B are equal under the given sort keys, and the input was [..., A, ..., B, ...], A must be placed before B in the output.

A sort key will never reference a non-existant element in one of the input lists.

No sort key will be repeated. Thus, [1, 2, 1] is not a valid list of sort keys.

Any elements not referenced by the sort keys do not factor into the sorting order. Only the initial relative order and the values of the elements referenced by the sort keys determine the output order.

You may choose whether the sort keys are zero-indexed or one-indexed.

There will be no negative values in the sort keys. If you choose to use one-indexing, there will be no zeroes in the sort keys either.

Integer values will not exceed your language's natively-representable range. If your chosen language is natively capable of arbitrary-precision integers (like Python), then any integer value can be present in the input, subject to memory constraints.

Reference Implementation (Python 2)

#!/usr/bin/env python

keys = input()
lists = input()

print sorted(lists, key=lambda l:[l[x] for x in keys])
```
<p>Try it online</p>
<h2>Test Cases</h2>
<p>Format: <code>keys lists -> output</code>. All sort keys are zero-indexed.</p>
```[1, 0, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[5, 2, 1], [6, 2, 1], [5, 3, 4]]
[1, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[6, 2, 1], [5, 2, 1], [5, 3, 4]]
[0, 1] [[1, 2], [2, 1]] -> [[1, 2], [2, 1]]
[1, 0] [[1, 2], [2, 1]] -> [[2, 1], [1, 2]]
[0] [[4], [10, 11, -88], [-2, 7]] -> [[-2, 7], [4], [10, 11, -88]]
[2] [[-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6]] -> [[-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2]]
[2, 1] [[9, 2, -2, -10, -6], [3, -4, -2]] -> [[3, -4, -2], [9, 2, -2, -10, -6]]
[2, 4, 8] [[5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5], [-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3]] -> [[-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3], [5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5]]
[1, 2, 3, 4, 5] [[-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [5, 3, -6, -5, -4, -4, -8, 2], [9, -4, 1, -1, -3, -2], [-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [1, -5, -3, -10, -7, 9, -8, -5, -1], [-9, 4, -1, -1, 2, 4]] -> [[-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -5, -3, -10, -7, 9, -8, -5, -1], [9, -4, 1, -1, -3, -2], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [5, 3, -6, -5, -4, -4, -8, 2], [-9, 4, -1, -1, 2, 4]]
[8, 7, 3, 2, 4, 9, 1] [[8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9]] -> [[10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5]]
```


答:
QBIC, <s>73</s> 64 bytes

```<code>:#0|{C=!q$D=@0.|[0,q*100|d=d+1?D+$LTRIM$|(C) D=D+A~d=a|_X]]q=q+1
</code>```

Saved 9 bytes by removing x as upper bound in the FOR loop. Upper bound is now set as q*100. Shame that QBasic automatically adds a space in front of a printed number, that's a costly LTRIM$...

Some explanation: q is used as the current number in the loop. This starts as 1 and gets incremented every 100N turns. This number gets converted to a string and is then appended to the string 0. and the correct number of 0's. In detail:

```<code>We use q as our 'base number', this is 1 implicitly
:                Get the max number of terms from a numeric CMD line param
#0|              Define string A$ as "0"
{                DO
C=!q$            our base number is cast to the string C$
D=@0.|           define D$ as "0."
[0,q*100|        FOR each of the terms we need to do for our base number
                 (i.e. 101 for 1, 201 for 2 ...)
d=d+1            Keep track of the total # of terms
                 (i.e. 101 after the 1 cycle, 302 after the 2...)
?D+$LTRIM$|(C)   Print to screen D$ + C$, where D$ = "0.[000]"
                 and C$ is our base number (1, or 2, or - much later - 100)
                 LTRIM is in there to prevent "0.00 1"
D=D+A            Add A$ to the end of D$ ("0.00" becomes "0.000")
~d=a|_X]         Stop if we've reached the max. # of terms
]                NEXT
q=q+1            If we've done all the terms necessary with this base number
                 then raise base number.
The DO loop gets closed implicitly by QBIC.
</code>```

Edit: QBIC has seen quite some development over time, and the above can now be solved in 49 bytes, 15 bytes shorter:

```<code>{D=@0.`[0,q*100|d=d+1?D+!q$┘D=D+@0`~d=a|_X]]q=q+1
</code>```

Title: 0.0000000000000000001

Body:
QBIC, <s>73</s> 64 bytes

:#0|{C=!q$D=@0.|[0,q*100|d=d+1?D+$LTRIM$|(C) D=D+A~d=a|_X]]q=q+1

Saved 9 bytes by removing x as upper bound in the FOR loop. Upper bound is now set as q*100. Shame that QBasic automatically adds a space in front of a printed number, that's a costly LTRIM$...

Some explanation: q is used as the current number in the loop. This starts as 1 and gets incremented every 100N turns. This number gets converted to a string and is then appended to the string 0. and the correct number of 0's. In detail:

We use q as our 'base number', this is 1 implicitly
:                Get the max number of terms from a numeric CMD line param
#0|              Define string A$ as "0"
{                DO
C=!q$            our base number is cast to the string C$
D=@0.|           define D$ as "0."
[0,q*100|        FOR each of the terms we need to do for our base number
                 (i.e. 101 for 1, 201 for 2 ...)
d=d+1            Keep track of the total # of terms
                 (i.e. 101 after the 1 cycle, 302 after the 2...)
?D+$LTRIM$|(C)   Print to screen D$ + C$, where D$ = "0.[000]"
                 and C$ is our base number (1, or 2, or - much later - 100)
                 LTRIM is in there to prevent "0.00 1"
D=D+A            Add A$ to the end of D$ ("0.00" becomes "0.000")
~d=a|_X]         Stop if we've reached the max. # of terms
]                NEXT
q=q+1            If we've done all the terms necessary with this base number
                 then raise base number.
The DO loop gets closed implicitly by QBIC.

Edit: QBIC has seen quite some development over time, and the above can now be solved in 49 bytes, 15 bytes shorter:

{D=@0.`[0,q*100|d=d+1?D+!q$┘D=D+@0`~d=a|_X]]q=q+1


答:
JavaScript (ES6), 55 bytes

```<code>(k,l)=>k.reduceRight((l,i)=>l.sort((a,b)=>a[i]-b[i]),l)
</code>```

The ECMAscript standard doesn't guarantee that the underlying sort is stable, so the following 68-byte code doesn't make that assumption:

```<code>(k,l)=>l.sort(g=(a,b,i=0)=>i<k.length?a[k[i]]-b[k[i]]||g(a,b,i+1):0)
</code>```

Title: Multiple-Key Sorting

Body:
JavaScript (ES6), 55 bytes

(k,l)=>k.reduceRight((l,i)=>l.sort((a,b)=>a[i]-b[i]),l)

The ECMAscript standard doesn't guarantee that the underlying sort is stable, so the following 68-byte code doesn't make that assumption:

(k,l)=>l.sort(g=(a,b,i=0)=>i<k.length?a[k[i]]-b[k[i]]||g(a,b,i+1):0)


答:
4 years, 99 bytes/77 chars

```<code>v=1//1;"""
 1991/*"""
for i in[0]:print 2010#➕➕
"""
"
>9002nnnn;
"""#*/
</code>```

Note: I'm not sure if the years are correct

Python 2.7, 2010

Javascript, 1991

Emotinomicon, 2015

><>, 2009

It took me a while to figure out how to make Python and JS work together.

Explanation

v=1//1;""" sets variable v to 1 divided by 1 in Python, and to 1 in Javascript (// starts a comment in Javascript), and ;""" starts a multiline string in Python. The ; can't be replaced with a newline because that would make Javascript stop working.

1991/*""" is the rest of the multiline string. The space is needed so that ><> doesn't push 1 to the stack. Since the start of the multiline string was part of a comment in Javascript, it prints 1991 and starts a multiline comment.

for i in[0]:print 2010#➕➕ in Python, is a for loop that iterates the list [0] and runs print 2010. The comment is just the Emotinomicon code (it ignores everything that isn't an emoji or a string). In ><>, it (f) pushes 15  to the stack.

The for loop can't be removed because since ><>'s IP is going down in column 1, and p isn't a valid command in ><>. You also can't replace it by an if statement, because i is the command to take input in ><>.

""" is the start of a multiline string.

" is part of the multiline string, needed to close the string we opened in ><> (the first quotation mark of the previous line started a string in ><>).

>9002nnnn; in ><>, changes IP direction to right, pushes 9, 0, 0 and 2, output these as numbers and ends the program.

"""#*/ in Python, ends the multiline string and starts a comment. In Javascript, */ makes the multiline comment end.

Bonus version with Gol><>:

5 languages, 4 years, <s>118</s> 114 bytes/<s>96</s> 92 chars

```<code>v=1//1;"""
 1991/*"""
for i in[0]:print 2010#➕➕
"""
`
"
>9002nnnn;
"
>5102nnnn;
"""#*/
</code>```

Golfish v0.4.2, 2015

Explanation²

IP starts at the upper left corner, going right. The v makes it go down.

f pushes 15.

" starts string.

` is used to escape characters, something that ><> doesn't have.

" should close the string, but we used `, so it won't.

> part of the string.

" ends the string.

>5102nnnn; is the actual code. > makes the IP go right, 5102 pushes 5, 1, 0 and 2, and nnnn; prints the numbers and ends the program.

Title: When was this language released?

Body:
Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that it must be written in as many different languages as possible.

Your score is the total number of different years that are correctly printed.

For each language you use, you must

Specify which version of the language you are using. (If there are multiple versions)

Specify what year that version was first released, and

Provide a link to a page proving the date of your version/language.

Any one of these counts as release date proof, as long as it specifies the version number (if applicable) and a release date.

A wikipedia page.

An esolangs page.

The language's official website. A github page or similar counts, as long as it has a release date. (Latest commit does not count, unless there is a version number somewhere in the code)

If there are not multiple versions or releases of a language, just use the initial release date of the language.

Minor versions of the same language do count as different languages, as long as they come from different years and still produce the correct output. You may not use any builtins that give you information (including release date) about the current version of the language you are using. For example, this is an invalid python submission:

```<code>import platform
i = platform.python_version()
if i == '3.5':
    print(2015)
if i == '3.4':
    print(2014)
if i == '3.3':
    print(2012)
...
</code>```

Whichever submission correctly prints the most distinct years wins!

Rules

Each program must print out the language year and nothing more. A trailing newline (windows style or *nix style) is allowed.

No programs may take any input.

In case of a tie, the shortest code scored in bytes wins. You may use whatever encoding you like for this, but all programs must use the same encoding.

Any of the programs may print to STDERR, or throw runtime/compile time errors and warnings as long as the correct output is still printed to STDOUT or a file.

Different languages may use different IO methods, but they most all be full programs, (functions not allowed for this challenge) and follow one of our default IO methods allowed.

Happy <s>golfing</s> polyglotting!

Body:
4 years, 99 bytes/77 chars

v=1//1;"""
 1991/*"""
for i in[0]:print 2010#➕➕
"""
"
>9002nnnn;
"""#*/

Note: I'm not sure if the years are correct

Python 2.7, 2010

Javascript, 1991

Emotinomicon, 2015

><>, 2009

It took me a while to figure out how to make Python and JS work together.

Explanation

v=1//1;""" sets variable v to 1 divided by 1 in Python, and to 1 in Javascript (// starts a comment in Javascript), and ;""" starts a multiline string in Python. The ; can't be replaced with a newline because that would make Javascript stop working.

1991/*""" is the rest of the multiline string. The space is needed so that ><> doesn't push 1 to the stack. Since the start of the multiline string was part of a comment in Javascript, it prints 1991 and starts a multiline comment.

for i in[0]:print 2010#➕➕ in Python, is a for loop that iterates the list [0] and runs print 2010. The comment is just the Emotinomicon code (it ignores everything that isn't an emoji or a string). In ><>, it (f) pushes 15  to the stack.

The for loop can't be removed because since ><>'s IP is going down in column 1, and p isn't a valid command in ><>. You also can't replace it by an if statement, because i is the command to take input in ><>.

""" is the start of a multiline string.

" is part of the multiline string, needed to close the string we opened in ><> (the first quotation mark of the previous line started a string in ><>).

>9002nnnn; in ><>, changes IP direction to right, pushes 9, 0, 0 and 2, output these as numbers and ends the program.

"""#*/ in Python, ends the multiline string and starts a comment. In Javascript, */ makes the multiline comment end.

Bonus version with Gol><>:

5 languages, 4 years, <s>118</s> 114 bytes/<s>96</s> 92 chars

v=1//1;"""
 1991/*"""
for i in[0]:print 2010#➕➕
"""
`
"
>9002nnnn;
"
>5102nnnn;
"""#*/

Golfish v0.4.2, 2015

Explanation²

IP starts at the upper left corner, going right. The v makes it go down.

f pushes 15.

" starts string.

` is used to escape characters, something that ><> doesn't have.

" should close the string, but we used `, so it won't.

> part of the string.

" ends the string.

>5102nnnn; is the actual code. > makes the IP go right, 5102 pushes 5, 1, 0 and 2, and nnnn; prints the numbers and ends the program.


问:
Compute the Mertens function
Given a positive integer n, compute the value of the Mertens function \$M(n)\$ where:

$$M(n) = \Sigma_{k=1}^{n}\mu(k)$$

and \$\mu(k)\$ is the Möbius function where \$μ(k) = 1\$ if \$k\$ has an even number of distinct prime factors, \$-1\$ if \$k\$ has an odd number of distinct prime factors, and \$0\$ if the prime factors are not distinct.

This is code-golf so create the shortest code for a function or program that computes the Mertens function for an input integer n > 0.

This is the OEIS sequence A002321.

Test Cases

```<code>n M(n)
1 1
2 0
3 -1
4 -1
5 -2
6 -1
7 -2
8 -2
9 -2
10 -1
117 -5
5525 5
7044 -25
8888 4
10000 -23
</code>```

ContentLicense: CC BY-SA 4.0

Title: Compute the Mertens function

Body:
Haskell, <s>29</s> 27 bytes

f n=1-sum(f.div n<$>[2..n])


答:
GNU sed 163 157

+2 included for -rn

```<code>s,^,0.1\n,;:;P;s,\.,.0,;s,.$,,;/0{101}/{s,0\.0*(09)?,\1,
s,.9*\n,x&,;h;s,.*x(.*)\n.*,\1,;y,0123456789,1234567890,
G;s,(.*\n)(.*)x.*\n(.*),0.\2\1\3,};/\n./b
</code>```

Takes input in unary based in this consensus.

Try it online!

An easy way to run this is:

```<code> yes 1 | head -{input} | tr -d '\n' | sed -rnf zeroOne.sed
</code>```

Explanation

```<code>s,^,0.1\n,                   #add 0.1 as the first line of the pattern space
:
P                            #print everything up to the first newline
s,\.,.0,                     #add a 0 after the .
s,.$,,                       #reduce the number left to print by one
/0{100}/{                    #if there is a string of 100 zero do the following
    s,0\.0*(09)?,\1,                 #get rid of all the 0s (except one if the we are adding another digit)
    s,.9*\n,x&,              #put an x before the left most number that will change
    h                        #store in hold space
    s,.*x(.*)\n.*,\1,        #remove everything except the numbers that change
    y,0123456789,1234567890, #replace numbers with the next one up
    G                        #bring the rest of the string back
    s,(.*\n)(.*)x.*\n(.*),0.\2\1\3,
                             #replace the x and numbers that changed with the new ones
}
/\n./b                   #branch back unless there isn't anything on the last line
</code>```

Title: 0.0000000000000000001

Body:
GNU sed 163 157

+2 included for -rn

s,^,0.1\n,;:;P;s,\.,.0,;s,.$,,;/0{101}/{s,0\.0*(09)?,\1,
s,.9*\n,x&,;h;s,.*x(.*)\n.*,\1,;y,0123456789,1234567890,
G;s,(.*\n)(.*)x.*\n(.*),0.\2\1\3,};/\n./b

Takes input in unary based in this consensus.

Try it online!

An easy way to run this is:

 yes 1 | head -{input} | tr -d '\n' | sed -rnf zeroOne.sed

Explanation

s,^,0.1\n,                   #add 0.1 as the first line of the pattern space
:
P                            #print everything up to the first newline
s,\.,.0,                     #add a 0 after the .
s,.$,,                       #reduce the number left to print by one
/0{100}/{                    #if there is a string of 100 zero do the following
    s,0\.0*(09)?,\1,                 #get rid of all the 0s (except one if the we are adding another digit)
    s,.9*\n,x&,              #put an x before the left most number that will change
    h                        #store in hold space
    s,.*x(.*)\n.*,\1,        #remove everything except the numbers that change
    y,0123456789,1234567890, #replace numbers with the next one up
    G                        #bring the rest of the string back
    s,(.*\n)(.*)x.*\n(.*),0.\2\1\3,
                             #replace the x and numbers that changed with the new ones
}
/\n./b                   #branch back unless there isn't anything on the last line


答:
AWK - 29 bytes

```<code>($0<c=$0~/\./?1.4:18){$0=c}1
</code>```

Usage:

```<code>awk '{c=$0~/\./?1.4:18}($0<c){$0=c}1' <<< number
</code>```

Testing was performed with gawk on RHEL 6.
I tried with all the test cases, unfortunately I don't have AWK on the machine that has internet access, so copy-paste is not possible.

Is there a more compact way to do this in AWK?

Title: Yes, of course I'm an adult!

Body:
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

Body:
AWK - 29 bytes

($0<c=$0~/\./?1.4:18){$0=c}1

Usage:

awk '{c=$0~/\./?1.4:18}($0<c){$0=c}1' <<< number

Testing was performed with gawk on RHEL 6.
I tried with all the test cases, unfortunately I don't have AWK on the machine that has internet access, so copy-paste is not possible.

Is there a more compact way to do this in AWK?


问:
"Hello world!", repeating each character n times
In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n.

For example, you might choose 2 for n. This means that every character used in your source code must be repeated that many times, or 0.

If I were to choose 3 for n, this program would be valid:

```<code>ab(b(b(aa)));;;
</code>```

Rules:

You cannot use any external resources

No user input can be provided

You must output exactly Hello world!, no more, no less. Newlines are the exception, they are optional.

n must be >= 2, to keep things interesting

It's highly discouraged to use comments to accomplish your goal.

Popularity contest, ending in 14 days. Highest score answer at the end wins!

答:
Jelly, 16 bytes (non-competing)

```<code>“⁸ƒẹI4»
“⁸ƒẹI4»
</code>```

(+trailing newline)

Try it online! (n = 2)

NO COMMENTS AT ALL. I assure you. Just Link 1 and the Main Link.

Body:
Jelly, 16 bytes (non-competing)

“⁸ƒẹI4»
“⁸ƒẹI4»

(+trailing newline)

Try it online! (n = 2)

NO COMMENTS AT ALL. I assure you. Just Link 1 and the Main Link.


问:
Count even steps of 196 algorithm
In the 196-algorithm one starts from an integer and then adds its reverse to it until a palindrome is reached, like this:

```<code>start -> 5280
5280 + 0825 = 6105
6105 + 5016 = 11121
11121 + 12111 = 23232
-end-
</code>```

Write a function that counts how many even numbers are visited before the algorithm ends. Starting and ending numbers are also counted, so, in the example above, visited are consider the numbers: 5280, 6105, 11121, 23232 but not 825, 5016 and 12111.

Examples:

```<code>f(5280) = 2
f(56) = 1
f(59) = 1
f(89) = 13
</code>```

Extended code golf rules apply: shortest number of instructions and operations (like +,-,mod,print,while,if,...) wins.

答:
Hey, looks like eval, for once, isn't forbidden here!

Perl, 1 instruction

```<code>sub f { eval << 'EOT' }
  my $n = $_[0];
  my $r = reverse $n;
  return !($n & 1) + ($r eq $n ? 0 : f($n+$r));
EOT
</code>```

Title: Count even steps of 196 algorithm

Body:
Hey, looks like eval, for once, isn't forbidden here!

Perl, 1 instruction

sub f { eval << 'EOT' }
  my $n = $_[0];
  my $r = reverse $n;
  return !($n & 1) + ($r eq $n ? 0 : f($n+$r));
EOT

ContentLicense: CC BY-SA 2.5


答:
Python 2, <s>73</s> 64 bytes

I think this is pretty short. I'm not sure that I can get it any shorter now that I golfed the if-else away.

s=z=1
exec'print"0.%0*d"%(z,s);q=z>s*100;z+=1-z*q;s+=q;'*input()
```
<p><strong>Try it online</strong></p>
<p>Less golfed:</p>
<pre class="lang-python prettyprint-override"><code>n=input()
s=z=1
for i in range(n):
    print"0.%0*d"%(z,s)
    if z>s*100:z=1;s+=1
    else:z+=1
</code>```

Title: 0.0000000000000000001

Body:
Notice the pattern in the below sequence:

```<code>0.1, 0.01, 0.001, 0.0001, 0.00001 and so on, until reaching 0.{one hundred zeros}1
</code>```

Then, continued:

```<code>0.2, 0.02, 0.002, 0.0002, 0.00002 and so on, until reaching 0.{two hundred zeros}2
</code>```

Continued:

```<code>0.3, 0.03, etc, until 0.{three hundred zeros}3
</code>```

Continued:

```<code>0.4, 0.04, etc, until 0.{four hundred zeros}4
</code>```

Sped up a bit:

```<code>0.10, 0.010, etc.  until 0.{one thousand zeros}10
</code>```

Sped up some more:

0.100, 0.0100...

You get the idea.

The input your code will receive is an integer, the number of terms, and the output is that many number of terms of the sequence.

Input and output formats are unrestricted, and separators are not required.

Trailing zeros are necessary.

Standard loopholes apply.

The outputs of some nth terms are given below:

```<code>nth term -> number
-------------------
1        -> 0.1
102      -> 0.2
303      -> 0.3
604      -> 0.4
1005     -> 0.5
1506     -> 0.6
2107     -> 0.7
2808     -> 0.8
3609     -> 0.9
4510     -> 0.10
</code>```

Body:
Python 2, <s>73</s> 64 bytes

I think this is pretty short. I'm not sure that I can get it any shorter now that I golfed the if-else away.

s=z=1
exec'print"0.%0*d"%(z,s);q=z>s*100;z+=1-z*q;s+=q;'*input()

Try it online

Less golfed:

n=input()
s=z=1
for i in range(n):
    print"0.%0*d"%(z,s)
    if z>s*100:z=1;s+=1
    else:z+=1


问:
Tips for Golfing in Go
What general tips do you have for golfing in Go? I'm new to Code Golfing and looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Go.

Please keep to one tip per answer.

答:
You can put any number of opening braces on one line, but a line that contains opening braces may contain at most one closing brace.

Correct:

```<code>func main(){if true{switch{case 1==1:for{break
}}}}
</code>```

Also correct:

```<code>func main(){if true{switch{case 1==1:for{break}
}}}
</code>```

Also correct:

```<code>func main(){if true{switch{case 1==1:for{
break}}}}
</code>```

Incorrect:

```<code>func main() {
    if true{for{break}}
}
</code>```

Title: Tips for Golfing in Go

Body:
You can put any number of opening braces on one line, but a line that contains opening braces may contain at most one closing brace.

Correct:

func main(){if true{switch{case 1==1:for{break
}}}}

Also correct:

func main(){if true{switch{case 1==1:for{break}
}}}

Also correct:

func main(){if true{switch{case 1==1:for{
break}}}}

Incorrect:

func main() {
    if true{for{break}}
}


答:
J, 6 bytes

```<code>]/:{&>
</code>```

Keys are zero-indexed. The LHS is the list of keys and the RHS is an array of values. Since J doesn't support ragged arrays, each array must be boxed.

Usage

```<code>   f =: ]/:{&>
   < 1 0 2
┌─────┐
│1 0 2│
└─────┘
   5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│5 3 4│6 2 1│5 2 1│
└─────┴─────┴─────┘
   (< 1 0 2) f  5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│5 2 1│6 2 1│5 3 4│
└─────┴─────┴─────┘
   (< 1 2) f  5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│6 2 1│5 2 1│5 3 4│
└─────┴─────┴─────┘
   (< 0) f 4 ; 10 11 _88 ; _2 7
┌────┬─┬─────────┐
│_2 7│4│10 11 _88│
└────┴─┴─────────┘
</code>```

Explanation

```<code>]/:{&>  Input: keys (LHS), values (RHS)
   {&>  Select from values at each index in keys
]       Get the values
 /:     Sort up the values using the ones selected with the keys
</code>```

Title: Multiple-Key Sorting

Body:
J, 6 bytes

]/:{&>

Keys are zero-indexed. The LHS is the list of keys and the RHS is an array of values. Since J doesn't support ragged arrays, each array must be boxed.

Usage

   f =: ]/:{&>
   < 1 0 2
┌─────┐
│1 0 2│
└─────┘
   5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│5 3 4│6 2 1│5 2 1│
└─────┴─────┴─────┘
   (< 1 0 2) f  5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│5 2 1│6 2 1│5 3 4│
└─────┴─────┴─────┘
   (< 1 2) f  5 3 4 ; 6 2 1 ; 5 2 1
┌─────┬─────┬─────┐
│6 2 1│5 2 1│5 3 4│
└─────┴─────┴─────┘
   (< 0) f 4 ; 10 11 _88 ; _2 7
┌────┬─┬─────────┐
│_2 7│4│10 11 _88│
└────┴─┴─────────┘

Explanation

]/:{&>  Input: keys (LHS), values (RHS)
   {&>  Select from values at each index in keys
]       Get the values
 /:     Sort up the values using the ones selected with the keys


问:
The Solitude of Prime Numbers
Recently I read the novel "The Solitude of Prime Numbers" where the main characters are somewhat compared to twin prime numbers ("always together, but never touching").

A twin prime is a prime number that is either \$\require{cancel}2\$ less or \$2\$ more than another prime number —for example, the twin prime pair \$(41, 43)\$. In other words, a twin prime is a prime that has a prime gap of two. Sometimes the term twin prime is used for a pair of twin primes; an alternative name for this is prime twin or prime pair. Wikipedia

Although I didn't like much the depressing novel, and since I have fallen into PPCG lately, that raised a question in my mind...

Task:

Given a positive integer number \$N > 4\$, find the lonely prime numbers (AKA isolated prime numbers) between the closest couples of twin primes.

Please note that in this case with the term lonely prime numbers, I mean all the prime numbers that are not twin primes and between couples of twin primes. That's why \$N > 4\$ because the first two couples of prime numbers are \$(3, 5)\$ and \$(5, 7)\$.

Example:

\$N = 90\$.

Find the first two couples of twin primes \$< N\$ and \$> N\$. They are: \$(71, 73)\$ and \$(101, 103)\$.

Find the lonely primes in the range \$> 73\$ and \$< 101\$.

They are: \$79, 83, 89, 97\$.

Special cases:

- If N is in between two twin prime numbers, find the closest couples of twin primes \$> N+1\$ and \$< N-1\$. Example: \$N=72\$, find the closest couples of twin primes \$> 73\$ and \$< 71\$ then exclude from the list \$71\$ and \$73\$ because they are not *lonely primes*. So for \$N = 72\$ the expected result is:  \$67, \cancel{71}, \cancel{73}, 79, 83, 89, 97\$
- If N belongs to a couple of twin primes, for example \$N = 73\$, the closest couples of twin primes are \$(71, 73)\$ and \$(101, 103)\$. If \$N = 71\$, the closest couples of twin primes are \$(59, 61)\$ and \$(71, 73)\$.

Test cases:

```<code>N = 70   >  Lonely primes are:  67
N = 71   >  Lonely primes are:  67
N = 72   >  Lonely primes are:  67, 79, 83, 89, 97 (not the twins 71 and 73)
N = 73   >  Lonely primes are:  79, 83, 89, 97
N = 90   >  Lonely primes are:  79, 83, 89, 97
N = 201  >  Lonely primes are:  211, 223
N = 499  >  Lonely primes are:  467, 479, 487, 491, 499, 503, 509
</code>```

Rules:

Write a full program or function that will take the number N from standard input.

Output the list of lonely primes in a readable format as csv, list, array, etc.

Shortest code wins.

Please include (when possible) a testable online fiddle.

答:
Python 2.7: 160 bytes

t=lambda n:all(n%d for d in range(2,n))
def l(n):
 i=n
 while t(i)*t(i+2)-1:i+=1
 while t(n)*t(n-2)-1:n-=1
 print[x for x in range(n,i)if t(x)&~(t(x-2)|t(x+2))]
```

suggestions are welcome :)

Title: The Solitude of Prime Numbers

Body:
Python 2.7: 160 bytes

t=lambda n:all(n%d for d in range(2,n))
def l(n):
 i=n
 while t(i)*t(i+2)-1:i+=1
 while t(n)*t(n-2)-1:n-=1
 print[x for x in range(n,i)if t(x)&~(t(x-2)|t(x+2))]

suggestions are welcome :)


问:
Praming Puzles & Colf: Condense a String
Having spend some time on this site I have come to enjoy things being as short as possible. That may be the reason why I'm recently kind of offended by strings containing the same characters more than once. Your job is to write a function or program which condenses a given string according to the following rules:

Start with a 0-condensation, that is look for the first (leftmost) pair of the same characters with 0 other characters between them. If such a pair is found, remove one of the two characters and restart the algorithm by performing another 0-condensation. If no such pair is found, proceed with the next step. Examples:

  programming -C0-> programing

  aabbcc -C0-> abbcc

  test -C0-> test

Then perform a 1-condensation, that is look for the first pair of same characters with 1 other character between them. If such a pair is found remove one of them and all characters between them and restart with a 0-condensation. If no such pair is found, proceed with the next step. Examples:

abacac -C1-> acac

java -C1-> ja

Continue with a 2-condensation and so on up to a n-condensation with n being the length of the original string, each time restarting after a condensation removed some letters. Examples:

programing -C2-> praming

abcdafg -C3-> afg

The resulting string is called condensed and contains each character at most once.

Input:

A lower case string of printable ascii-characters.

Output:

The condensed string according to the rules above.

Examples:

```<code>examples     -> es
programming  -> praming
puzzles      -> puzles
codegolf     -> colf
andromeda    -> a
abcbaccbabcb -> acb
if(x==1):x++ -> if(x+
fnabnfun     -> fun
abcdefae     -> abcde
</code>```

Detailed examples to clarify how the algorithm works:

```<code>fnabnfun -C0-> fnabnfun -C1-> fnabnfun -C2-> fnfun -C0-> fnfun -C1-> fun -C0-> fun
 -C1-> fun -C2-> ... -C8-> fun

abcbaccbabcb -C0-> abcbacbabcb -C0-> abcbacbabcb -C1-> abacbabcb -C0-> abacbabcb
 -C1-> acbabcb -C0-> acbabcb -C1-> acbcb -C0-> acbcb -C1-> acb -C0-> acb
 -C1-> ... -C12-> acb
</code>```

Your approach doesn't have to implement the algorithm from above as long as your solution and the algorithm return the same output for all allowed inputs.
This is a code-golf challenge.

Thanks to @Linus for helpful sandbox comments!

答:
Ruby, <s>75</s> <s>64</s> 57 bytes

(56 bytes of code + p command line option.)

Using string interpolation inside a regex to control the length of the matches that are replaced.

i=0
~/(.).{#{i}}\1/?sub($&,$1)&&i=0: i+=1while i<$_.size
```

<p>Test:</p>

```$ ruby -p condense.rb <<< fnabnfun
fun
```

Body:
Ruby, <s>75</s> <s>64</s> 57 bytes

(56 bytes of code + p command line option.)

Using string interpolation inside a regex to control the length of the matches that are replaced.

i=0
~/(.).{#{i}}\1/?sub($&,$1)&&i=0: i+=1while i<$_.size

Test:

$ ruby -p condense.rb <<< fnabnfun
fun


Title: 0.0000000000000000001

Body:
Perl 5, 57 52 bytes

(needs -E for say)

for(1..<>){say"0."."0"x$i++.$.;$.++,$i=0if$i>100*$.}

Or readably:

# $. is the input line number, use it to count the
# number at the end.
# $i counts zeroes in the middle, starts at 0 implicitly
for(1..<>){                      # get the number of terms from stdin and loop
                                 # <> implicitly increases $. (to 1)
    say "0." . "0" x $i++ . $.;  # print the number, add one zero
    $.++, $i=0 if $i > 100 * $.; # increment the number, reset number
                                 # of zeroes if we've printed enough
}

Trailing zeroes are printed since the number after the row of zeroes is just an integer concatenated as a string.

Test run:

$ perl -E 'for(1..<>){say"0."."0"x$i++.$.;$.++,$i=0if$i>100*$.}' | tail -3
4511
0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009
0.10
0.010


Title: Multiple-Key Sorting

Body:
Given a list of indices and zero or more lists of integers, output the lists of integers, sorted in ascending order, with the key priority from the first input.

Example

Let the keys input be [1, 0, 2], and the lists input be [[5, 3, 4], [6, 2, 1], [5, 2, 1]]. Those lists need to be sorted by their second element, then first element, then third element, in ascending order:

First, we sort by the values at index 1: [[6, 2, 1], [5, 2, 1], [5, 3, 4]]

Next, we break any ties from the first sort using the values at index 0: [[5, 2, 1], [6, 2, 1], [5, 3, 4]]

Finally, we break any remaining ties with the vlues at index 2 (this doesn't actually change anything, because there are no ties remaining).

Details

Sorting is stable: if two elements compare equal with respect to the given sort keys, they must remain in the same relative order in the output. For example, if A and B are equal under the given sort keys, and the input was [..., A, ..., B, ...], A must be placed before B in the output.

A sort key will never reference a non-existant element in one of the input lists.

No sort key will be repeated. Thus, [1, 2, 1] is not a valid list of sort keys.

Any elements not referenced by the sort keys do not factor into the sorting order. Only the initial relative order and the values of the elements referenced by the sort keys determine the output order.

You may choose whether the sort keys are zero-indexed or one-indexed.

There will be no negative values in the sort keys. If you choose to use one-indexing, there will be no zeroes in the sort keys either.

Integer values will not exceed your language's natively-representable range. If your chosen language is natively capable of arbitrary-precision integers (like Python), then any integer value can be present in the input, subject to memory constraints.

Reference Implementation (Python 2)

#!/usr/bin/env python

keys = input()
lists = input()

print sorted(lists, key=lambda l:[l[x] for x in keys])
```
<p>Try it online</p>
<h2>Test Cases</h2>
<p>Format: <code>keys lists -> output</code>. All sort keys are zero-indexed.</p>
```[1, 0, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[5, 2, 1], [6, 2, 1], [5, 3, 4]]
[1, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[6, 2, 1], [5, 2, 1], [5, 3, 4]]
[0, 1] [[1, 2], [2, 1]] -> [[1, 2], [2, 1]]
[1, 0] [[1, 2], [2, 1]] -> [[2, 1], [1, 2]]
[0] [[4], [10, 11, -88], [-2, 7]] -> [[-2, 7], [4], [10, 11, -88]]
[2] [[-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6]] -> [[-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2]]
[2, 1] [[9, 2, -2, -10, -6], [3, -4, -2]] -> [[3, -4, -2], [9, 2, -2, -10, -6]]
[2, 4, 8] [[5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5], [-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3]] -> [[-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3], [5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5]]
[1, 2, 3, 4, 5] [[-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [5, 3, -6, -5, -4, -4, -8, 2], [9, -4, 1, -1, -3, -2], [-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [1, -5, -3, -10, -7, 9, -8, -5, -1], [-9, 4, -1, -1, 2, 4]] -> [[-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -5, -3, -10, -7, 9, -8, -5, -1], [9, -4, 1, -1, -3, -2], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [5, 3, -6, -5, -4, -4, -8, 2], [-9, 4, -1, -1, 2, 4]]
[8, 7, 3, 2, 4, 9, 1] [[8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9]] -> [[10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5]]
```

Body:
JavaScript (ES6) 46

k=>l=>l.sort((a,b)=>k.some(i=>v=a[i]-b[i])&&v)

At each comparison during the sort, scan the key indices to find the right order

Test

f=k=>l=>l.sort((a,b)=>k.some(i=>v=a[i]-b[i])&&v)

;`[1, 0, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[5, 2, 1], [6, 2, 1], [5, 3, 4]]
[1, 2] [[5, 3, 4], [6, 2, 1], [5, 2, 1]] -> [[6, 2, 1], [5, 2, 1], [5, 3, 4]]
[0, 1] [[1, 2], [2, 1]] -> [[1, 2], [2, 1]]
[1, 0] [[1, 2], [2, 1]] -> [[2, 1], [1, 2]]
[0] [[4], [10, 11, -88], [-2, 7]] -> [[-2, 7], [4], [10, 11, -88]]
[2] [[-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6]] -> [[-9, 8, -5, -1, -7, -8, -5, -6, 5, -6, 6], [-7, 6, 2, -8, -7, 7, -3, 3, 0, -6, 1], [-1, -5, 8, -1, -4, -10, -5, 4, 4, 6, -8, 4, 2]]
[2, 1] [[9, 2, -2, -10, -6], [3, -4, -2]] -> [[3, -4, -2], [9, 2, -2, -10, -6]]
[2, 4, 8] [[5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5], [-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3]] -> [[-7, -8, -6, 7, 3, 8, 6, -7, -2, 0, -6, -4, 4, -3, 2, -3], [5, -3, 4, -6, -1, -2, -2, -4, 5], [-2, -3, 6, -4, -1, -4, -4, -5, 8, 9, 9, -3, 3, -9, -3], [2, 0, 10, -10, -1, 2, -1, 5, -1, 10, -5]]
[1, 2, 3, 4, 5] [[-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [5, 3, -6, -5, -4, -4, -8, 2], [9, -4, 1, -1, -3, -2], [-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [1, -5, -3, -10, -7, 9, -8, -5, -1], [-9, 4, -1, -1, 2, 4]] -> [[-6, -10, 4, -10, 6, 6, -1, 3, 0, 0], [1, -5, -3, -10, -7, 9, -8, -5, -1], [9, -4, 1, -1, -3, -2], [1, -2, -7, -6, -7, -7, -1, 0, -4, 3, 3], [-9, -1, -7, -9, -10, -2, -8, -10, -10, -3], [7, -1, -7, 2, -2, 9, 7, 5, -6, -8], [-7, 3, -8, 3, 5, -1, 6, -6, 9, 8], [5, 3, -6, -5, -4, -4, -8, 2], [-9, 4, -1, -1, 2, 4]]
[8, 7, 3, 2, 4, 9, 1] [[8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9]] -> [[10, -1, 3, 0, -4, 1, -5, -4, -1, -7, 9, -9, -1, -5, 7, 8, 9, 6, -3], [5, 6, -9, 0, -1, 5, 4, 7, 5, 10, 2, 5, 7, -9], [0, -9, -7, -2, 2, -5, 7, 4, 6, -4, 1, 8, -7, 10], [4, -8, 6, -10, -2, -3, 2, -6, 9, 5, 4, 10, 2, 3], [8, -5, 1, -6, -1, -4, 6, 10, 10, 6, 9, 5]]`
.split('\n').map(row=>{
  var [keys,list,expected]=row.split(/] -?>? ?\[/)
  keys=eval(keys+']');
  list=eval('['+list+']');
  expected=eval('['+expected);
  var result=f(keys)(list);
  var ok=result.join`|`==expected.join`|`;
  console.log(ok?'OK':'KO',keys+' '+list.join`|`+' -> ' +expected.join`|`,ok?'':result.join`|`)
})


问:
De-Snakify a String
A regular string looks like this:

```<code>Hello,IAmAStringSnake!
</code>```

And a string snake looks something like this:

```<code>Hel
  l      rin
  o,IAmASt g
           S
       !ekan
</code>```

Your Task

String snakes are dangerous, so you must make a program that takes a string snake as input and outputs it as a regular string.

Specifications

Input can be a multiline string or an array of strings.

Each line of the input will be padded with spaces to form a rectangular grid.

Characters in the snake can only connect to adjacent characters above, below, left or right of them (just like in the game Snake). They cannot go diagonal.

The snake characters will never be adjacent to another part of the snake, only the connected characters.

The first character of the string is the end character with the shortest Manhattan distance from the top-left corner of the input grid (i.e. the minimum number of moves it would take for a snake to go directly from the end character to the top-left corner). Both ends will never have the same distance.

The string can contain any ASCII character between code points 33 and 126 inclusive (no spaces or newlines).

The string will be between 2 and 100 characters long.

Shortest code in bytes wins.

Test Cases

(Input grid, followed by the output string)

```<code>Hel
  l      rin
  o,IAmASt g
           S
       !ekan

Hello,IAmAStringSnake!

----------

Python

Python

----------

P  ngPu  Code
r  i  z  d  G
o  m  z  n  o
gram  lesA  lf

ProgrammingPuzzlesAndCodeGolf

----------

   ~ zyx tsr XWVUTSR
   }|{ wvu q Y     Q
!          p Z `ab P
"#$ 6789:; o [ _ c O
  % 5    < n \]^ d N
('& 432  = m     e M
)     1  > lkjihgf L
*+,-./0  ?         K
         @ABCDEFGHIJ

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

----------

  tSyrep
  r    p
  in Sli
   g    Sile
   Snakes  n
Ser      ylt
a eh   ilS
fe w   t
   emo h
     Sre

SlipperyStringSnakesSilentlySlitherSomewhereSafe
</code>```

答:
Python 2, 251 bytes

w=s.find('\n')+1;q=' ';p=q*w+'\n';s=list(p+s+p);d=-w,1,w,-1
def r(x):c=s[x];s[x]=q;v=[c+r(x+o)for o in d if s[x+o]>q];return v[0]if v else c
e=[x for x in range(len(s))if s[x]>q and sum([s[x+o]>q for o in d])<2]
print r(e[e[0]/w+e[0]%w>e[1]/w+e[1]%w])
```
<p>Or, if you want leading newlines in your testcases, 257 bytes:</p>
<pre class="lang-python prettyprint-override"><code>w=s.find('\n',1);q=' ';p=q*-~w+'\n';s=list(p+s[1:]+p);d=-w,1,w,-1
def r(x):c=s[x];s[x]=q;v=[c+r(x+o)for o in d if s[x+o]>q];return v[0]if v else c
e=[x for x in range(len(s))if s[x]>q and sum([s[x+o]>q for o in d])<2]
print r(e[e[0]/w+e[0]%w>e[1]/w+e[1]%w])
</code>```

Passes all testcases.

s="""
  tSyrep
  r    p
  in Sli
   g    Sile
   Snakes  n
Ser      ylt
a eh   ilS
fe w   t
   emo h
     Sre
"""
```
<p>Results in:</p>
```SlipperyStringSnakesSilentlySlitherSomewhereSafe
```

Title: De-Snakify a String

Body:
Python 2, 251 bytes

w=s.find('\n')+1;q=' ';p=q*w+'\n';s=list(p+s+p);d=-w,1,w,-1
def r(x):c=s[x];s[x]=q;v=[c+r(x+o)for o in d if s[x+o]>q];return v[0]if v else c
e=[x for x in range(len(s))if s[x]>q and sum([s[x+o]>q for o in d])<2]
print r(e[e[0]/w+e[0]%w>e[1]/w+e[1]%w])

Or, if you want leading newlines in your testcases, 257 bytes:

w=s.find('\n',1);q=' ';p=q*-~w+'\n';s=list(p+s[1:]+p);d=-w,1,w,-1
def r(x):c=s[x];s[x]=q;v=[c+r(x+o)for o in d if s[x+o]>q];return v[0]if v else c
e=[x for x in range(len(s))if s[x]>q and sum([s[x+o]>q for o in d])<2]
print r(e[e[0]/w+e[0]%w>e[1]/w+e[1]%w])

Passes all testcases.

s="""
  tSyrep
  r    p
  in Sli
   g    Sile
   Snakes  n
Ser      ylt
a eh   ilS
fe w   t
   emo h
     Sre
"""

Results in:

SlipperyStringSnakesSilentlySlitherSomewhereSafe


答:
Perl, <s>87</s> <s>85</s> <s>82</s> 81 bytes

Includes +4 for -pX

Give input on STDIN as one line with n first (notice this is the reverse of the order suggested in the challenge). So to calculate U(1000000, 100):

```<code>unlucky.pl <<< "100 1000000"
</code>```

Algorithm based on aditsu's lucky numbers answer
The time complexity is O(n^2) so it's rather fast for the required range. The 100, 1000000 case gives 5333213163 in 0.7 seconds. Due to the problems perl has with do$0 based recursion it uses a lot of memory. Rewriting it as a function would make the memory use O(n) but is a number of bytes longer

unlucky.pl:

```<code>#!/usr/bin/perl -pX
$_=$a{$_}||=/\d+$/>--$_?2*$&+$^S:($_=$_.A.(do$0,$^S?0|$&+$&/~-$_:$&*$_-1),do$0)
</code>```

This works as shown, but use literal ^S to get the claimed score.

I am not aware of any earlier use of $^S in perlgolf.

Title: Unlucky Numbers!

Body:
Things to know:

First, lucky numbers.

Lucky numbers are generated like so:

Take all the natural numbers:

```<code>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20...
</code>```

Then, remove each second number.

```<code>1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39...
</code>```

Now, 3 is safe.

Remove every 3rd number:

```<code>1, 3, 7, 9, 13, 15, 19, 21, 25, 27, 31, 33, 37, 39, 43, 45, 49, 51, 55, 59...
</code>```

Now, 7 is safe.

Remove every 7th number.

Continue, and remove every nth number, where n is the first safe number after an elimination.

The final list of safe numbers is the lucky numbers.

The unlucky numbers is composed of separate lists of numbers, which are [U1, U2, U3... Un].

U1 is the first set of numbers removed from the lucky "candidates", so they are:

```<code>2, 4, 6, 8, 10, 12, 14, 16, 18, 20...
</code>```

U2 is the second set of numbers removed:

```<code>5, 11, 17, 23, 29, 35, 41, 47, 53, 59...
</code>```

And so on and so forth (U3 is the third list, U4 is the fourth, etc.)

Challenge:

Your task is, when given two inputs m and n, generate the mth number in the list Un.

Example inputs and outputs:

```<code>(5, 2) -> 29
(10, 1) -> 20
</code>```

Specs:

Your program must work for m up to 1e6, and n up to 100.

You are guaranteed that both m and n are positive integers.

If you're curious, U(1e6, 100) = 5,333,213,163. (Thank you @pacholik!)

Your program must compute that within 1 day on a reasonable modern computer.

This is code-golf, so shortest code in bytes wins!

PS: It would be nice if someone came up with a general formula for generating these. If you do have a formula, please put it in your answer!

Body:
Perl, <s>87</s> <s>85</s> <s>82</s> 81 bytes

Includes +4 for -pX

Give input on STDIN as one line with n first (notice this is the reverse of the order suggested in the challenge). So to calculate U(1000000, 100):

unlucky.pl <<< "100 1000000"

Algorithm based on aditsu's lucky numbers answer
The time complexity is O(n^2) so it's rather fast for the required range. The 100, 1000000 case gives 5333213163 in 0.7 seconds. Due to the problems perl has with do$0 based recursion it uses a lot of memory. Rewriting it as a function would make the memory use O(n) but is a number of bytes longer

unlucky.pl:

#!/usr/bin/perl -pX
$_=$a{$_}||=/\d+$/>--$_?2*$&+$^S:($_=$_.A.(do$0,$^S?0|$&+$&/~-$_:$&*$_-1),do$0)

This works as shown, but use literal ^S to get the claimed score.

I am not aware of any earlier use of $^S in perlgolf.


答:
C++, 68 bytes

```<code>int A(int a){return a<18?18:a;}float A(float h){return h<1.4?1.4:h;}
</code>```

This answer is actually 2 functions with the same name, and the compiler works out for me which to call, so it acts as one function without me having to take in one input and decide which it is. Since input on the floating point is guaranteed to be of the same precision as the output, I can return it safely without having to truncate it either.

Ungolfed + tests

```<code>#include <iostream>

int A(int a)
{
   return a < 18 ? 18 : a;
}

float A(float h)
{
   return h < 1.4 ? 1.4 : h;
}

int main()
{
  std::cout << 0 << " " << A(0) << "\n";
  std::cout << 19 << " " << A(19) << "\n";
  std::cout << 1.1 << " " << A(1.1f) << "\n";
  std::cout << 2.2 << " " << A(2.2f) << "\n";
}
</code>```

Title: Yes, of course I'm an adult!

Body:
C++, 68 bytes

int A(int a){return a<18?18:a;}float A(float h){return h<1.4?1.4:h;}

This answer is actually 2 functions with the same name, and the compiler works out for me which to call, so it acts as one function without me having to take in one input and decide which it is. Since input on the floating point is guaranteed to be of the same precision as the output, I can return it safely without having to truncate it either.

Ungolfed + tests

#include <iostream>

int A(int a)
{
   return a < 18 ? 18 : a;
}

float A(float h)
{
   return h < 1.4 ? 1.4 : h;
}

int main()
{
  std::cout << 0 << " " << A(0) << "\n";
  std::cout << 19 << " " << A(19) << "\n";
  std::cout << 1.1 << " " << A(1.1f) << "\n";
  std::cout << 2.2 << " " << A(2.2f) << "\n";
}


Title: Yes, of course I'm an adult!

Body:
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

This is code-golf, so shortest answer in bytes wins.

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

Body:
C, <s>119</s> <s>111</s> <s>105</s> 100

m;f(char*s){float atof(),l=atof(s);for(m=s;*s&&*s++!=46;);puts(*s?l<1.4?"1.4":m:atoi(m)>18?m:"18");}

Tested with

main(c,v)char**v;{
    f("0");
    f("1");
    f("2");
    f("12");
    f("18");
    f("44");
    f("115");
    f("122");
    f("0.0");
    f("1.04");
    f("1.225");
    f("1.339");
    f("1.4");
    f("1.74");
    f("2.0");
    f("2.72");
}

Output

18
18
18
12
18
44
115
122
1.4
1.4
1.4
1.4
1.4
1.74
2.0
2.72


Title: Yes, of course I'm an adult!

Body:
C, 50 bytes:

#define A(x)(x/2+(x+1)/2-x?x<1.4?1.4:x:x<18?18:x)

The byte count includes the newline at the end of the macro definition.

Test:

#define A(x)(x/2+(x+1)/2-x?x<1.4?1.4:x:x<18?18:x)
#include <assert.h>
int main() {
  assert(A(0) == 18);
  assert(A(1) == 18);
  assert(A(2) == 18);
  assert(A(12) == 18);
  assert(A(18) == 18);
  assert(A(43) == 43);
  assert(A(115) == 115);
  assert(A(122) == 122);
  assert(A(0.0) == 1.4);
  assert(A(1.04) == 1.4);
  assert(A(1.225) == 1.4);
  assert(A(1.399) == 1.4);
  assert(A(1.4) == 1.4);
  assert(A(1.74) == 1.74);
  assert(A(2.0) == 2.0);
  assert(A(2.72) == 2.72);
}


答:
C, <s>51 50</s> 47 bytes

```<code>f(n,t,u){for(t=u=1;n/++u;t-=f(n/u));return t;}
</code>```

Edit: Thanks to @Dennis for -3 bytes!

Title: Compute the Mertens function

Body:
Given a positive integer n, compute the value of the Mertens function \$M(n)\$ where:

$$M(n) = \Sigma_{k=1}^{n}\mu(k)$$

and \$\mu(k)\$ is the Möbius function where \$μ(k) = 1\$ if \$k\$ has an even number of distinct prime factors, \$-1\$ if \$k\$ has an odd number of distinct prime factors, and \$0\$ if the prime factors are not distinct.

This is code-golf so create the shortest code for a function or program that computes the Mertens function for an input integer n > 0.

This is the OEIS sequence A002321.

Test Cases

```<code>n M(n)
1 1
2 0
3 -1
4 -1
5 -2
6 -1
7 -2
8 -2
9 -2
10 -1
117 -5
5525 5
7044 -25
8888 4
10000 -23
</code>```

Body:
C, <s>51 50</s> 47 bytes

f(n,t,u){for(t=u=1;n/++u;t-=f(n/u));return t;}

Edit: Thanks to @Dennis for -3 bytes!


答:
Scala, 53 bytes

```<code>def?(n:Int,k:Int=2):Int=if(n<k)1 else?(n,k+1)- ?(n/k)
</code>```

A port of Dennis's pythin answer.

I've called the method ?, which is a token that doesn't stick to letters.

Title: Compute the Mertens function

Body:
Scala, 53 bytes

def?(n:Int,k:Int=2):Int=if(n<k)1 else?(n,k+1)- ?(n/k)

A port of Dennis's pythin answer.

I've called the method ?, which is a token that doesn't stick to letters.


答:
Mathematica, 70 bytes

```<code>Take[Join@@Table["0."<>Array["0"&,k]<>ToString@m,{m,#},{k,0,100m}],#]&
</code>```

Unnamed function that takes the desired length as its argument and returns a list of strings (using strings instead of numbers makes the trailing zeros easy to include).

This version is slow as hell! because if you want, for example, the first 10 terms, it actually computes the sequence all the way through the 10th segment (101 + 201 + ... + 1001 = 5510 terms) and then retains only the first 10. So already at input 303, it's computing nearly five million terms and discarding almost all of them. The 81-byte version

```<code>Take[Join@@Table["0."<>Array["0"&,k]<>ToString@m,{m,Sqrt[#/50]+1},{k,0,100m}],#]&
</code>```

doesn't have this flaw, and in fact calculates nearly the fewest segments possible.

Title: 0.0000000000000000001

Body:
Notice the pattern in the below sequence:

```<code>0.1, 0.01, 0.001, 0.0001, 0.00001 and so on, until reaching 0.{one hundred zeros}1
</code>```

Then, continued:

```<code>0.2, 0.02, 0.002, 0.0002, 0.00002 and so on, until reaching 0.{two hundred zeros}2
</code>```

Continued:

```<code>0.3, 0.03, etc, until 0.{three hundred zeros}3
</code>```

Continued:

```<code>0.4, 0.04, etc, until 0.{four hundred zeros}4
</code>```

Sped up a bit:

```<code>0.10, 0.010, etc.  until 0.{one thousand zeros}10
</code>```

Sped up some more:

0.100, 0.0100...

You get the idea.

The input your code will receive is an integer, the number of terms, and the output is that many number of terms of the sequence.

Input and output formats are unrestricted, and separators are not required.

Trailing zeros are necessary.

Standard loopholes apply.

The outputs of some nth terms are given below:

```<code>nth term -> number
-------------------
1        -> 0.1
102      -> 0.2
303      -> 0.3
604      -> 0.4
1005     -> 0.5
1506     -> 0.6
2107     -> 0.7
2808     -> 0.8
3609     -> 0.9
4510     -> 0.10
</code>```

Body:
Mathematica, 70 bytes

Take[Join@@Table["0."<>Array["0"&,k]<>ToString@m,{m,#},{k,0,100m}],#]&

Unnamed function that takes the desired length as its argument and returns a list of strings (using strings instead of numbers makes the trailing zeros easy to include).

This version is slow as hell! because if you want, for example, the first 10 terms, it actually computes the sequence all the way through the 10th segment (101 + 201 + ... + 1001 = 5510 terms) and then retains only the first 10. So already at input 303, it's computing nearly five million terms and discarding almost all of them. The 81-byte version

Take[Join@@Table["0."<>Array["0"&,k]<>ToString@m,{m,Sqrt[#/50]+1},{k,0,100m}],#]&

doesn't have this flaw, and in fact calculates nearly the fewest segments possible.


答:
3 years, 3 languages: C, TeX, MIXAL

```<code>*main(){puts("1990");}/*\newwrite\O\openout\O=O\write\O{1982}\bye
START   ENTA    1997
        CHAR
        STX     6
        OUT     6(19)
        HLT
        END     START   */
</code>```

Name the file date.mixal.

C (1990) -- Compiles with warnings and prints 1990 to stdout.

TeX (1982) -- Compile with tex date.mixal; prints 1982 to the file O.tex (ignore the DVI output).

MIXAL (1997) -- Compile using GNU Mix Development Kit, mixasm date.mixal and run with mixvm -r date.mix; prints 1997 to the teletype device (=stdout).

The TeX and MIXAL programs are in a comment in the C program; the MIXAL program comes after \bye so TeX ignores it. The C and TeX programs are a comment in the MIXAL program. For some reason gcc is willing to accept *main.

Title: When was this language released?

Body:
Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that it must be written in as many different languages as possible.

Your score is the total number of different years that are correctly printed.

For each language you use, you must

Specify which version of the language you are using. (If there are multiple versions)

Specify what year that version was first released, and

Provide a link to a page proving the date of your version/language.

Any one of these counts as release date proof, as long as it specifies the version number (if applicable) and a release date.

A wikipedia page.

An esolangs page.

The language's official website. A github page or similar counts, as long as it has a release date. (Latest commit does not count, unless there is a version number somewhere in the code)

If there are not multiple versions or releases of a language, just use the initial release date of the language.

Minor versions of the same language do count as different languages, as long as they come from different years and still produce the correct output. You may not use any builtins that give you information (including release date) about the current version of the language you are using. For example, this is an invalid python submission:

```<code>import platform
i = platform.python_version()
if i == '3.5':
    print(2015)
if i == '3.4':
    print(2014)
if i == '3.3':
    print(2012)
...
</code>```

Whichever submission correctly prints the most distinct years wins!

Rules

Each program must print out the language year and nothing more. A trailing newline (windows style or *nix style) is allowed.

No programs may take any input.

In case of a tie, the shortest code scored in bytes wins. You may use whatever encoding you like for this, but all programs must use the same encoding.

Any of the programs may print to STDERR, or throw runtime/compile time errors and warnings as long as the correct output is still printed to STDOUT or a file.

Different languages may use different IO methods, but they most all be full programs, (functions not allowed for this challenge) and follow one of our default IO methods allowed.

Happy <s>golfing</s> polyglotting!

Body:
3 years, 3 languages: C, TeX, MIXAL

*main(){puts("1990");}/*\newwrite\O\openout\O=O\write\O{1982}\bye
START   ENTA    1997
        CHAR
        STX     6
        OUT     6(19)
        HLT
        END     START   */

Name the file date.mixal.

C (1990) -- Compiles with warnings and prints 1990 to stdout.

TeX (1982) -- Compile with tex date.mixal; prints 1982 to the file O.tex (ignore the DVI output).

MIXAL (1997) -- Compile using GNU Mix Development Kit, mixasm date.mixal and run with mixvm -r date.mix; prints 1997 to the teletype device (=stdout).

The TeX and MIXAL programs are in a comment in the C program; the MIXAL program comes after \bye so TeX ignores it. The C and TeX programs are a comment in the MIXAL program. For some reason gcc is willing to accept *main.


答:
C#, 58 bytes

```<code>x=>x is int?(int)x>17?x:18:(float)x<1.4?"1.4":$"{x:.0##}";
</code>```

No crazy string parsing needed for C#. Input is expected to be an int or float (unfortunately C# can't cast a double to float if the double is in an object). Output will be either int or string in an object.

(almost missed the at least 1 decimal requirement, added that now)

Ungolfed:

```<code>/*Func<object, object> Lambda = */ x =>
    x is int // if parameter is an int
        ? (int)x > 17 // check if x is at least 18
            ? x // at least 18 so return x
            : 18 // less than 18 so return 18
        : (float)x < 1.4 // x is float, check if at least 1.4
            ? "1.4" // less than 1.4 so return 1.4
            : $"{x:.0##"} // at least 1.4 so return x and ensure at least 1 decimal place
;
</code>```

Alternate implementation which is also 58 bytes.

```<code>x=>x is int?(int)x>17?x:18:$"{((float)x<1.4?1.4:x):.0##}";
</code>```

Title: Yes, of course I'm an adult!

Body:
C#, 58 bytes

x=>x is int?(int)x>17?x:18:(float)x<1.4?"1.4":$"{x:.0##}";

No crazy string parsing needed for C#. Input is expected to be an int or float (unfortunately C# can't cast a double to float if the double is in an object). Output will be either int or string in an object.

(almost missed the at least 1 decimal requirement, added that now)

Ungolfed:

/*Func<object, object> Lambda = */ x =>
    x is int // if parameter is an int
        ? (int)x > 17 // check if x is at least 18
            ? x // at least 18 so return x
            : 18 // less than 18 so return 18
        : (float)x < 1.4 // x is float, check if at least 1.4
            ? "1.4" // less than 1.4 so return 1.4
            : $"{x:.0##"} // at least 1.4 so return x and ensure at least 1 decimal place
;

Alternate implementation which is also 58 bytes.

x=>x is int?(int)x>17?x:18:$"{((float)x<1.4?1.4:x):.0##}";


答:
Pyth, 12 bytes

Defines a function y that takes in the n.

```<code>L-1syM/LbtSb
</code>```

Test suite here. (Note that the trailing y here is to actually call the declared function.)

Title: Compute the Mertens function

Body:
Pyth, 12 bytes

Defines a function y that takes in the n.

L-1syM/LbtSb

Test suite here. (Note that the trailing y here is to actually call the declared function.)


答:
Turtlèd, n=3, (noncompeting)

N=3, because of "Hello world!" having three ls.

```<code>'!' ' HHeeowwrrdd"Hello world!""!
</code>```

Try it online

Explanation:

```<code>'!                                write exclamation mark
  ' '                             write space twice on the same cell as exclamation mark
      HHeeowwrrdd                 balances chars in Hello world!, moves the pointer
                 "Hello world!"   Write Hello world! to grid
                               "! Write the exclamation mark again, on top of the last one
</code>```

Title: "Hello world!", repeating each character n times

Body:
In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n.

For example, you might choose 2 for n. This means that every character used in your source code must be repeated that many times, or 0.

If I were to choose 3 for n, this program would be valid:

```<code>ab(b(b(aa)));;;
</code>```

Rules:

You cannot use any external resources

No user input can be provided

You must output exactly Hello world!, no more, no less. Newlines are the exception, they are optional.

n must be >= 2, to keep things interesting

It's highly discouraged to use comments to accomplish your goal.

Popularity contest, ending in 14 days. Highest score answer at the end wins!

Body:
Turtlèd, n=3, (noncompeting)

N=3, because of "Hello world!" having three ls.

'!' ' HHeeowwrrdd"Hello world!""!

Try it online

Explanation:

'!                                write exclamation mark
  ' '                             write space twice on the same cell as exclamation mark
      HHeeowwrrdd                 balances chars in Hello world!, moves the pointer
                 "Hello world!"   Write Hello world! to grid
                               "! Write the exclamation mark again, on top of the last one


答:
Cheddar, <s>23</s> 21 bytes

```<code>n->[n,n%1?1.4:18].max
</code>```

Nothing super-new but I'll post it as it's pretty short.

Title: Yes, of course I'm an adult!

Body:
Cheddar, <s>23</s> 21 bytes

n->[n,n%1?1.4:18].max

Nothing super-new but I'll post it as it's pretty short.


答:
Befunge 98 - 26 bytes

Since I had to duplicate the r anyway, I figured I may as well make the source text read left-to-right rather than typical gnirts Befunge style. There's nothing particularly notable about this; I'm not sure if having code that simply isn't executed counts as a comment, but the six characters Hel w! are just ignored.

```<code>rHel w!@,dk"Hello, world!"
</code>```

Body:
Befunge 98 - 26 bytes

Since I had to duplicate the r anyway, I figured I may as well make the source text read left-to-right rather than typical gnirts Befunge style. There's nothing particularly notable about this; I'm not sure if having code that simply isn't executed counts as a comment, but the six characters Hel w! are just ignored.

rHel w!@,dk"Hello, world!"