问:
Draw an ASCII chess board!
Here is a simple challenge for you: You must produce this ASCII representation of a chess board. White is represented by uppercase characters, and black is represented by lowercase. Empty tiles are represented by a .. Here is the full board:

```<code>rnbqkbnr
pppppppp
........
........
........
........
PPPPPPPP
RNBQKBNR
</code>```

Since this is a kolmogorov-complexity question, you may not take any input and you must output this board by any default method, for example, saving a file, printing to STDOUT or returning from a function. You may optionally produce one trailing newline. Standard loopholes apply, and the shortest program in bytes!

However, remember this is equally as much a competition between submissions in the same language. While it's unlikely that a languages like Java could beat a language like perl, or a golfing language like pyth or cjam, having the shortest Java answer is still really impressive! To help you track the shortest answer in each language, you may use this leaderboard, which will show the shortest submission by language and overall.

Leaderboards

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

var QUESTION_ID=95745,OVERRIDE_USER=31716;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Python, 69 bytes

```<code>n='\n'
p,a='p'*8+n,'rnbqkbnr'+n
print a+p+('.'*8+n)*4+(p+a).upper()
</code>```

There are two things that frustrate me with this code: the print and "upper". Wouldn't an up function be cool? Anyway, here's my first golf answer.

Title: Draw an ASCII chess board!

Body:
Python, 69 bytes

n='\n'
p,a='p'*8+n,'rnbqkbnr'+n
print a+p+('.'*8+n)*4+(p+a).upper()

There are two things that frustrate me with this code: the print and "upper". Wouldn't an up function be cool? Anyway, here's my first golf answer.


问:
Shrinking numbers
The input is an array of (at least 3, maximum 20) different integers. Each integer is greater than -1000 and smaller than 1000.

Your task is to shrink the numbers by "linearly mapping" them from 0.0 to 1.0. This means the smallest number in the array will be mapped to 0.0, the largest to 1.0.

You get the array as a parameter (inside a function) or stdin/program arguments (you can choose). Print out the result in the format double1;double2;double3;.... The output has to have the same order as the input.

If you want, you can round the output to 2 digits after the decimal point. There must be atleast 1 digit after the decimal point.

The usage of built-in functions (functions which scale down the numbers for you, such as mathematicas Rescale) is disallowed.

Examples:

```<code>Input              Output
[5,-20,30]         0.5;0.0;1.0
[1,2,3,4,5]        0.0;0.25;0.5;0.75;1.0
[0,5,100,400]      0.0;0.01;0.25;1.0
</code>```

(The last output is rounded, otherwise it would be 0.0;0.0125;0.25;1.0)

答:
05AB1E, 13 bytes (Non-competing)

```<code>ZsWD1.S*+s/Z/
</code>```

Try it online!

ContentLicense: CC BY-SA 3.0

Title: Shrinking numbers

Body:
05AB1E, 13 bytes (Non-competing)

ZsWD1.S*+s/Z/

Try it online!


问:
N(e(s(t))) a string
To "function nest" a string, you must:

Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was Hello, then the first step would be:

```<code>H(ello)
</code>```

Then, repeat this same step for every substring. So we get:

```<code>H(ello)
H(e(llo))
H(e(l(lo)))
H(e(l(l(o))))
</code>```

Your task is to write a program or function that "function nests" a string. For example, if the input string was Hello world!, then you should output:

```<code>H(e(l(l(o( (w(o(r(l(d(!)))))))))))
</code>```

The input will only ever contain printable ASCII, and you may take the input and the output in any reasonable format. For example, STDIN/STDOUT, function arguments and return value, reading and writing to a file, etc.

For simplicity's sake, you may also assume the input will not contain parentheses, and will not be empty.

```<code>Input:
Nest a string
Output:
N(e(s(t( (a( (s(t(r(i(n(g))))))))))))

Input:
foobar
Output:
f(o(o(b(a(r)))))

Input:
1234567890
Output:
1(2(3(4(5(6(7(8(9(0)))))))))

Input:
code-golf
Output:
c(o(d(e(-(g(o(l(f))))))))

Input:
a
Output:
a

Input:
42
Output:
4(2)
</code>```

As usual, all of our default rules and loopholes apply, and the shortest answer scored in bytes wins!

答:
V, 9 bytes

```<code>$òys$)hhl
</code>```

Try it online!

Title: N(e(s(t))) a string

Body:
V, 9 bytes

$òys$)hhl

Try it online!


问:
Find the "unwrapped size" of a list
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

This is code-golf, so the shortest program (in bytes) wins.

答:
Jelly, 4 bytes

```<code>ß€S‘
</code>```

Doesn't use string manipulation. Try it online! or verify all test cases.

How it works

```<code>ß€S‘  Main link. Argument: A (array)

ß€    Map the main link over A.
  S   Sum. For empty arrays, this yields zero.
   ‘  Increment.
</code>```

Title: Find the "unwrapped size" of a list

Body:
Jelly, 4 bytes

ß€S‘

Doesn't use string manipulation. Try it online! or verify all test cases.

How it works

ß€S‘  Main link. Argument: A (array)

ß€    Map the main link over A.
  S   Sum. For empty arrays, this yields zero.
   ‘  Increment.


问:
Test a number for narcissism
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

答:
Perl, 27 +3 = 30 bytes

Run with -F.  Older versions of Perl might require you to run with -nF instead, if -F does not imply -n.

```<code>grep$;+=$_**$#F,@F;say$_==$
</code>```

Prints 1 if narcissistic, prints nothing otherwise.

(thanks to @Dada for byte-count correction, and for -2 bytes)

ContentLicense: CC BY-SA 4.0

Title: Test a number for narcissism

Body:
Perl, 27 +3 = 30 bytes

Run with -F.  Older versions of Perl might require you to run with -nF instead, if -F does not imply -n.

grep$;+=$_**$#F,@F;say$_==$

Prints 1 if narcissistic, prints nothing otherwise.

(thanks to @Dada for byte-count correction, and for -2 bytes)


问:
Find the Factorial!
Create the shortest program or function that finds the factorial of a non-negative integer.

The factorial, represented with ! is defined as such

$$n!:=\begin{cases}1 & n=0\\n\cdot(n-1)!&n>0\end{cases}$$

In plain English the factorial of 0 is 1 and the factorial of n, where n is larger than 0 is n times the factorial of one less than n.

Your code should perform input and output using a standard methods.

Requirements:

Does not use any built-in libraries that can calculate the factorial (this includes any form of eval)

Can calculate factorials for numbers up to 125

Can calculate the factorial for the number 0 (equal to 1)

Completes in under a minute for numbers up to 125

The shortest submission wins, in the case of a tie the answer with the most votes at the time wins.

答:
Oasis, 3 bytes

Try it online

```<code>n*1
</code>```

Explanation:

```<code>n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1
</code>```

Title: Find the Factorial!

Body:
Oasis, 3 bytes

Try it online

n*1

Explanation:

n*1
n    Push n
 *   Multiply the two items on the top of the stack
     Because there is only one item on the stack, A(n - 1) is pushed
     Implicit output
  1  Special case A(0) = 1


答:
JavaScript ES6, 50 bytes

```<code>v=>[...s=v+""].map(x=>v-=Math.pow(x,s.length))&&!v
</code>```

Convert the number to a string and iterate through the digits,
subtract the power computation from the original number
use the ! operator to invert the logic so that a 0 result returns true and non-zero returns false.

Title: Test a number for narcissism

Body:
A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits.

For example, take \$153\$ (3 digits):

\$1^3 + 5^3 + 3^3 = 153\$

\$1634\$:

\$1^4 + 6^4 + 3^4 + 4^4 = 1634 = 1 + 1296 + 81 + 256 = 1634\$

The Challenge:

Your code must take input from the user and output True or False depending upon whether the given number is a Narcissistic Number.

Error checking for text strings or other invalid inputs is not required. 1 or 0 for the output is acceptable. Code that simply generates a list of Narcissistic Numbers, or checks the user input against a hardcoded list, does not qualify.

OEIS A005188

Body:
JavaScript ES6, 50 bytes

v=>[...s=v+""].map(x=>v-=Math.pow(x,s.length))&&!v

Convert the number to a string and iterate through the digits,
subtract the power computation from the original number
use the ! operator to invert the logic so that a 0 result returns true and non-zero returns false.


答:
Brainfuck, 28 bytes

```<code>,
[
  -
  [
    -
    [
      >+<-
      [->]
    ]
    >[>>]
    <<<
  ]
  ,
]
>.
</code>```

Try it online.

This counts the number of input characters divisible by 3, i.e. the number of ] characters.

Alternate 34-byte solution counting [ characters directly and relying on 8-bit cells:

```<code>,
[
  <-[>-<---]
  >------
  [>-<[-]]
  >+<,
]
>.
</code>```

Title: Find the "unwrapped size" of a list

Body:
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

This is code-golf, so the shortest program (in bytes) wins.

Body:
Brainfuck, 28 bytes

,
[
  -
  [
    -
    [
      >+<-
      [->]
    ]
    >[>>]
    <<<
  ]
  ,
]
>.

Try it online.

This counts the number of input characters divisible by 3, i.e. the number of ] characters.

Alternate 34-byte solution counting [ characters directly and relying on 8-bit cells:

,
[
  <-[>-<---]
  >------
  [>-<[-]]
  >+<,
]
>.


答:
C#, 46 41 bytes

```<code>int u(string l){return l.Count(c=>c=='[');}
</code>```

l is the string of nested list. Test it here.

Title: Find the "unwrapped size" of a list

Body:
C#, 46 41 bytes

int u(string l){return l.Count(c=>c=='[');}

l is the string of nested list. Test it here.


问:
How to randomize letters in a word
According to some controversial story, the odrer of ltteres in a wrod deos not mttaer much for raednig, as lnog as the frist and lsat lteter macth with the orignial wrod.

So, for fun, what would be the shortest function to randomize letter order in a word while keeping the first and the last letter in place?

Here's my stab at it with JavaScript. All whitespace removed it's at 124 130 characters.

```<code>function r(w) {
  var l=w.length-1;
  return l<3?w:w[0]+w.slice(1,l).split("").sort(function(){return Math.random()-.5}).join("")+w[l];
}
</code>```

Shorter JavaScript always welcome.

Edit: length check added. Function should not fail for short words.

答:
Ruby, 39 characters

```<code>->s{a,*b,c=s.chars;[a,*b.shuffle,c]*''}
</code>```

Title: How to randomize letters in a word

Body:
Ruby, 39 characters

->s{a,*b,c=s.chars;[a,*b.shuffle,c]*''}


答:
Bash + coreutils, 29 bytes

```<code>f()(echo $1|tr -d -c [|wc -c)
</code>```

Title: Find the "unwrapped size" of a list

Body:
Bash + coreutils, 29 bytes

f()(echo $1|tr -d -c [|wc -c)


答:
Scala, 15 bytes

```<code>s=>s.count(92<)
</code>```

Ungolfed:

```<code>s=>s.count(c=>92<c)
</code>```

count counts how many elements satisfy a predicate, in this case 92<, which is the method < of 92.

Title: Find the "unwrapped size" of a list

Body:
Scala, 15 bytes

s=>s.count(92<)

Ungolfed:

s=>s.count(c=>92<c)

count counts how many elements satisfy a predicate, in this case 92<, which is the method < of 92.


问:
Polyglot Anagrams Cops' Thread
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Title: Polyglot Anagrams Cops' Thread

Body:
05AB1E, 8 bytes, A000042, Cracked

F1}J,(1&

Test cases:

1 -> 1
2 -> 11
3 -> 111


答:
JavaScript, 36 bytes

```<code>([...v])=>v.join`(`+v.fill``.join`)`
</code>```

I can't seem to beat the top score of 34 bytes, but I thought I would share my different approach.

Title: N(e(s(t))) a string

Body:
To "function nest" a string, you must:

Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was Hello, then the first step would be:

```<code>H(ello)
</code>```

Then, repeat this same step for every substring. So we get:

```<code>H(ello)
H(e(llo))
H(e(l(lo)))
H(e(l(l(o))))
</code>```

Your task is to write a program or function that "function nests" a string. For example, if the input string was Hello world!, then you should output:

```<code>H(e(l(l(o( (w(o(r(l(d(!)))))))))))
</code>```

The input will only ever contain printable ASCII, and you may take the input and the output in any reasonable format. For example, STDIN/STDOUT, function arguments and return value, reading and writing to a file, etc.

For simplicity's sake, you may also assume the input will not contain parentheses, and will not be empty.

```<code>Input:
Nest a string
Output:
N(e(s(t( (a( (s(t(r(i(n(g))))))))))))

Input:
foobar
Output:
f(o(o(b(a(r)))))

Input:
1234567890
Output:
1(2(3(4(5(6(7(8(9(0)))))))))

Input:
code-golf
Output:
c(o(d(e(-(g(o(l(f))))))))

Input:
a
Output:
a

Input:
42
Output:
4(2)
</code>```

As usual, all of our default rules and loopholes apply, and the shortest answer scored in bytes wins!

Body:
JavaScript, 36 bytes

([...v])=>v.join`(`+v.fill``.join`)`

I can't seem to beat the top score of 34 bytes, but I thought I would share my different approach.


答:
><>, <s>21</s> <s>20</s> 18 bytes

```<code>0i:0(90.;n?|3%0=+!
</code>```

Edit: score 1 for goto statements!

Edit 2: Apparently ><> differs from Befunge in that it allows non-zero IP offset after wrapping (in other words, by using a trampoline instruction, I can wrap to (1, 0) instead of (0, 0)). Interesting.

TryItOnline!

Title: Find the "unwrapped size" of a list

Body:
><>, <s>21</s> <s>20</s> 18 bytes

0i:0(90.;n?|3%0=+!

Edit: score 1 for goto statements!

Edit 2: Apparently ><> differs from Befunge in that it allows non-zero IP offset after wrapping (in other words, by using a trampoline instruction, I can wrap to (1, 0) instead of (0, 0)). Interesting.

TryItOnline!


问:
Polyglot Anagrams Robbers' Thread
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

答:
Dip, 8 bytes, Oliver, A000042

```<code>(1J&F},1
</code>```

Explanation

```<code>              #Implicit Input
(             #Start range loop
 1            #Push 1 to the stack
  J           #Join all the elements in the stack
   &          #End program
    F},1      #These are ignored
</code>```

The funny thing is that this was the intended language! Dip is an esolang created by Oliver.

Test Cases and Running Dip from Command-Line

```<code>$python3 dip.py
Dip v1.0.0 by Oliver Ni.
>>> (1J&F},1
> 4
1111
>>> (1J&F},1
> 7
1111111
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
Dip, 8 bytes, Oliver, A000042

(1J&F},1

Explanation

              #Implicit Input
(             #Start range loop
 1            #Push 1 to the stack
  J           #Join all the elements in the stack
   &          #End program
    F},1      #These are ignored

The funny thing is that this was the intended language! Dip is an esolang created by Oliver.

Test Cases and Running Dip from Command-Line

$python3 dip.py
Dip v1.0.0 by Oliver Ni.
>>> (1J&F},1
> 4
1111
>>> (1J&F},1
> 7
1111111


答:
Haskell, <s>20 19</s> 17 bytes

f s=sum[1|']'<-s]
```
<p>Try it online!</p>
<p>Takes the list as string and puts a <code>1</code> in a list for each <code>]</code>, then sums up all the <code>1</code>s.</p>
<hr />
<p><strong>Pointfree version:</strong> (19 bytes)</p>
<pre class="lang-haskell prettyprint-override"><code>length.filter(>'[')
</code>```

Assumes , [ ] are the only chars in the string. Filters the list to get all chars greater than [, which are all ] and returns the length.

Usage:

Prelude> length.filter(=='[')$"[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]]"
19
```

Title: Find the "unwrapped size" of a list

Body:
Haskell, <s>20 19</s> 17 bytes

f s=sum[1|']'<-s]

Try it online!

Takes the list as string and puts a 1 in a list for each ], then sums up all the 1s.

Pointfree version: (19 bytes)

length.filter(>'[')

Assumes , [ ] are the only chars in the string. Filters the list to get all chars greater than [, which are all ] and returns the length.

Usage:

Prelude> length.filter(=='[')$"[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]]"
19


答:
Befunge, <s>22</s> <s>18</s> 16 bytes

```<code>~:0#@`#.!#$_3%!+
</code>```

TryItOnline!

Edit: Thanks to Martin Ender for shaving off 4 bytes!

Edit2: Credit to David Holderness for optimizing out two more

Title: Find the "unwrapped size" of a list

Body:
Befunge, <s>22</s> <s>18</s> 16 bytes

~:0#@`#.!#$_3%!+

TryItOnline!

Edit: Thanks to Martin Ender for shaving off 4 bytes!

Edit2: Credit to David Holderness for optimizing out two more


答:
Befunge-98, <s>12</s> <s>11</s> <s>10</s> 9 bytes

```<code>~3%!+2j@.
</code>```

TryItOnline!

Edit: Thanks to Martin Ender for shaving off a byte

Title: Find the "unwrapped size" of a list

Body:
Befunge-98, <s>12</s> <s>11</s> <s>10</s> 9 bytes

~3%!+2j@.

TryItOnline!

Edit: Thanks to Martin Ender for shaving off a byte


问:
Count up folks!

Introduction

It may sound strange, but we haven't got ONE challenge for counting from 1 to n, inclusive.

This is not the same thing. That one is a (closed) not well-explained challenge.

This is not the same thing. That one is about counting up indefinitely.

Challenge

Write a program or function that prints every integer from 1 to n inclusive.

Rules

You can get n any way.

You can assume that n will always be a positive integer.

You can get n in any base, but you should always output in decimal.

Output must be separated by any character (or pattern) not in 0123456789. Non-decimal leading or trailing characters are allowed (for example when using arrays such as [1, 2, 3, 4, 5, 6]).

Standard loopholes are denied.

We want to find the shortest approach in each language, not the shortest language, so I will not accept any answer.

You must update your answer(s) after this edit, answers posted before the last edit must comply with the change rule about standard loopholes (I didn't want to deny them, but I didn't want to make the community roar, so I denied them).

You can use any post-dating language version (or language). You cannot use any language or language version made just for this challenge.

Bonuses

20%

Your program must be able to count at least up to 18446744073709551615 (2^64-1). For example, if a new datatype is the only way to support big integers, you must construct it. If your language does not have any way to support huge integers up to 2^64-1, the upper limit of that particular language must be supported instead.

EDIT: I've changed the limit from 2^64 to 2^64-1 to allow more answers.

EDIT: I made the 2^64-1 rule a bonus, since there has not been much interest in this challenge. If your answer supports 2^64-1, you can now edit it to include the bonus. Also, you can post an answer not supporting it, if it is shorter.

答:
PostL  20 bytes

PostL is a postfix-notation stack-based language based purely on the stack, a single variable, and many operators, and its interpreter is currently written in Java.

```<code>1N0,$)B>\`]`=>1+.6;>
</code>```

Explanation:

```<code>1N0,$)B>\`]`=>1+.6;>
1                    Push 1 onto the stack
 N                   Negate it (gives -1; negative literals don't exist)
  0                  Push 0 onto the stack
   ,$                Take the input and parse it to an number
     )               Take the range, counting by -1, to 0, starting at whatever the input was
      B>             Check whether or not the stack is empty, and push that onto the stack (0 for not, 1 for empty)
        \`           Push on a SKIP processor flag, and move the value of the emptiness of the stack back to the top (swap the top two)
          ]`         Push on a TERMINATE processor flag, and swap the top two.
            =        Switch, based on whether or not the stack is empty. If not, retrieve the SKIP flag, and if so, retrieve the TERMINATE flag.
             >       Process whatever flag is there. If it's a SKIP flag, it doesn't do anything, but if it's a TERMINATE flag, it means that the stack is empty, and it terminates.
              1+     Add 1 (because the range is 0 to n - 1)
                .    Pop it off the stack and print it
                 6;> Go to index 6 (where the program checks if the stack is empty).
</code>```

Title: Count up folks!

Body:
PostL  20 bytes

PostL is a postfix-notation stack-based language based purely on the stack, a single variable, and many operators, and its interpreter is currently written in Java.

1N0,$)B>\`]`=>1+.6;>

Explanation:

1N0,$)B>\`]`=>1+.6;>
1                    Push 1 onto the stack
 N                   Negate it (gives -1; negative literals don't exist)
  0                  Push 0 onto the stack
   ,$                Take the input and parse it to an number
     )               Take the range, counting by -1, to 0, starting at whatever the input was
      B>             Check whether or not the stack is empty, and push that onto the stack (0 for not, 1 for empty)
        \`           Push on a SKIP processor flag, and move the value of the emptiness of the stack back to the top (swap the top two)
          ]`         Push on a TERMINATE processor flag, and swap the top two.
            =        Switch, based on whether or not the stack is empty. If not, retrieve the SKIP flag, and if so, retrieve the TERMINATE flag.
             >       Process whatever flag is there. If it's a SKIP flag, it doesn't do anything, but if it's a TERMINATE flag, it means that the stack is empty, and it terminates.
              1+     Add 1 (because the range is 0 to n - 1)
                .    Pop it off the stack and print it
                 6;> Go to index 6 (where the program checks if the stack is empty).


问:
Print a ballot!
As you all know, today is election day!

Your task today is to print out a ballot, given an input.

If the input is Hillary Clinton, print:

```<code>Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>
</code>```

However, if the input is Donald Trump, print:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>
</code>```

If it is something else, write it on the third line:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Oliver Ni         ===-----===>
</code>```

(Technically, I'm not 18 yet...)

Remember, this is code-golf, so the code with the fewest bytes wins.

答:
C#, 266 Bytes

Golfed:

```<code>string B(string s){var h="Hilary Clinton".PadRight(17);var d="Donald Trump".PadRight(17);var r="===     ===>\n";var c=r.Replace(" ", "-");var b="____________".PadRight(17);return s==h.Trim()?s.PadRight(17)+c+d+r+b+r:s==d.Trim()?h+r+d+c+b+r:h+r+d+r+s.PadRight(17)+c;}
</code>```

Ungolfed:

```<code>public string B(string s)
{
  var h = "Hilary Clinton".PadRight(17);
  var d = "Donald Trump".PadRight(17);
  var r = "===     ===>\n";
  var c = r.Replace(" ", "-");
  var b = "____________".PadRight(17);
  return s == h.Trim() ? s.PadRight(17) + c + d + r + b + r :
    s == d.Trim() ? h + r + d + c + b + r :
      h + r + d + r + s.PadRight(17) + c;
}
</code>```

Tried to create a Func for all those PadRights...Exactly the same byte count...

Testing:

```<code>var printABallot = new PrintABallot();
Console.WriteLine(printABallot.B("Hilary Clinton"));

Hilary Clinton   ===-----===>
Donald Trump     ===     ===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Donald Trump"));

Hilary Clinton   ===     ===>
Donald Trump     ===-----===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Kanye West"));

Hilary Clinton   ===     ===>
Donald Trump     ===     ===>
Kanye West       ===-----===>
</code>```

Title: Print a ballot!

Body:
C#, 266 Bytes

Golfed:

string B(string s){var h="Hilary Clinton".PadRight(17);var d="Donald Trump".PadRight(17);var r="===     ===>\n";var c=r.Replace(" ", "-");var b="____________".PadRight(17);return s==h.Trim()?s.PadRight(17)+c+d+r+b+r:s==d.Trim()?h+r+d+c+b+r:h+r+d+r+s.PadRight(17)+c;}

Ungolfed:

public string B(string s)
{
  var h = "Hilary Clinton".PadRight(17);
  var d = "Donald Trump".PadRight(17);
  var r = "===     ===>\n";
  var c = r.Replace(" ", "-");
  var b = "____________".PadRight(17);
  return s == h.Trim() ? s.PadRight(17) + c + d + r + b + r :
    s == d.Trim() ? h + r + d + c + b + r :
      h + r + d + r + s.PadRight(17) + c;
}

Tried to create a Func for all those PadRights...Exactly the same byte count...

Testing:

var printABallot = new PrintABallot();
Console.WriteLine(printABallot.B("Hilary Clinton"));

Hilary Clinton   ===-----===>
Donald Trump     ===     ===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Donald Trump"));

Hilary Clinton   ===     ===>
Donald Trump     ===-----===>
____________     ===     ===>

Console.WriteLine(printABallot.B("Kanye West"));

Hilary Clinton   ===     ===>
Donald Trump     ===     ===>
Kanye West       ===-----===>


Title: Make me a blanket!

Body:
I want a blanket that looks like this. Each strip goes over, under, over, under. Can you print it?

```<code>\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\////
  ////    ////    ////    ////    ////    ////
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\
\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\////
  ////    ////    ////    ////    ////    ////
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\
\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\////
  ////    ////    ////    ////    ////    ////
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\
</code>```

Trailing spaces at the end of each line and trailing newlines are acceptable.

Remember, this is code-golf, so the code with the fewest bytes wins.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

var QUESTION_ID=99023,OVERRIDE_USER=12537;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Haskell, 96 bytes

f n=n`mod`8`div`4
putStr$unlines[["\\ //\\ \\/"!!(f(x-y)+2*f(x+y)+4*f y)|x<-[0..47]]|y<-[0..23]]


答:
Python 2, 35 bytes, A048735, Safe

```<code>print(lambda u:u&u<<1)(input())>>1
</code>```

The original solution was in my own programming language Wise.

```<code>:<<>&>print(lambda uuu1)(input())1
</code>```

Most of the characters are irrelevant no-ops.  The important characters are the first six. : creates two copies of the first item on the stack.  <<> bit shifts twice to the left and once to the right which is equivalent to bit shifting once to the left.  & takes the bitwise and of the top and second item (the original and the bit shifted copy).  Lastly > bit shifts once to the right.

Title: Polyglot Anagrams Cops' Thread

Body:
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Body:
Python 2, 35 bytes, A048735, Safe

print(lambda u:u&u<<1)(input())>>1

The original solution was in my own programming language Wise.

:<<>&>print(lambda uuu1)(input())1

Most of the characters are irrelevant no-ops.  The important characters are the first six. : creates two copies of the first item on the stack.  <<> bit shifts twice to the left and once to the right which is equivalent to bit shifting once to the left.  & takes the bitwise and of the top and second item (the original and the bit shifted copy).  Lastly > bit shifts once to the right.


答:
<s>Python 3, 27 bytes, A000012</s>, Cracked

No input this time!

```<code>if 1:
    if 1:
        print( '1' )
</code>```

The indents are tabs, but not to save bytes - they are required for whitespace.

I don't think it needs a TIO link or explanation!

(Probably won't take long to crack in some way)

Intended answer (Whitespace):

```<code>-Start-

    if1:if1:print('1')
-End-
</code>```

(Start and end not part of the program)

Sorry, I forgot to add that it prints to STDERR:

Try it online!

Title: Polyglot Anagrams Cops' Thread

Body:
<s>Python 3, 27 bytes, A000012</s>, Cracked

No input this time!

if 1:
    if 1:
        print( '1' )

The indents are tabs, but not to save bytes - they are required for whitespace.

I don't think it needs a TIO link or explanation!

(Probably won't take long to crack in some way)

Intended answer (Whitespace):

-Start-

    if1:if1:print('1')
-End-

(Start and end not part of the program)

Sorry, I forgot to add that it prints to STDERR:

Try it online!


答:
Python 3.6, 132 bytes

```<code>i=input()
s=['Hillary Clinton','Donald Trump','_'*12]
if x not in s:s[2]=i
for k in s:print(f'{k:18}==={" -"[k==i]*5}===>')
</code>```

Uses 3.6's new f-strings.

Title: Print a ballot!

Body:
As you all know, today is election day!

Your task today is to print out a ballot, given an input.

If the input is Hillary Clinton, print:

```<code>Hillary Clinton   ===-----===>
Donald Trump      ===     ===>
____________      ===     ===>
</code>```

However, if the input is Donald Trump, print:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===-----===>
____________      ===     ===>
</code>```

If it is something else, write it on the third line:

```<code>Hillary Clinton   ===     ===>
Donald Trump      ===     ===>
Oliver Ni         ===-----===>
</code>```

(Technically, I'm not 18 yet...)

Remember, this is code-golf, so the code with the fewest bytes wins.

Body:
Python 3.6, 132 bytes

i=input()
s=['Hillary Clinton','Donald Trump','_'*12]
if x not in s:s[2]=i
for k in s:print(f'{k:18}==={" -"[k==i]*5}===>')

Uses 3.6's new f-strings.


答:
05AB1E, 27 bytes, boboquack, A000012

```<code>1 1pif:
    if :
        rint( '1' )
</code>```

Try it online

How it works:

```<code>1                     # push 1
  1                   # push 1
   p                  # pop (1), push is_prime(1)
    i                 # pop (is_prime(1), false), if is false so don't execute rest
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

Body:
05AB1E, 27 bytes, boboquack, A000012

1 1pif:
    if :
        rint( '1' )

Try it online

How it works:

1                     # push 1
  1                   # push 1
   p                  # pop (1), push is_prime(1)
    i                 # pop (is_prime(1), false), if is false so don't execute rest


答:
Ruby, 135 bytes

puts [3320,1212,720,2172,6520,4144,2920,3184].map{|e|(e.to_s(3).rjust(8,"0").gsub("0"," ").gsub("1","\\").gsub("2","/"))*6+"\n"}.join*3

The number array corresponds to each component of each line, translated to base 3:  = 0, \ = 1, /= 2, then converted to decimal. The gsub() calls are too big, though.

And, just now, I saw @ElPedro's answer. :-( Just coincidence.

Title: Make me a blanket!


答:
Pyth, 76 bytes

```<code>V{+_tW!}zJ[*\_12"Donald Trump""Hillary Clinton")Jzs[.[Nd18K*\=3*?qzN\-d5K\>
</code>```

Title: Print a ballot!

Body:
Pyth, 76 bytes

V{+_tW!}zJ[*\_12"Donald Trump""Hillary Clinton")Jzs[.[Nd18K*\=3*?qzN\-d5K\>


答:
O, 15 bytes

```<code>i~{1\{nJ+}d}J;J
</code>```

Try it here!

In the input, any commas must be either removed or replaced by spaces.

Explanation

```<code>i~{1\{nJ+}d}J;J
i                Read a line of input.
 ~               Evaluate it.
  {        }J;   Define a function and save it into the `J` variable.
                 Currently, the input array is at the top of the stack.
   1\            Push 1 and swap it with the input array.
     {   }d      For each element in the array...
                 Because the array was popped by `d`, 1 is at the TOS.
      nJ+        Recurse and add the result to 1.
              J  Initiate the function call.
                 The result is printed implicitly.
</code>```

If we're allowed to take work on a string: 10 bytes

```<code>ie\']-e@-p
</code>```

Title: Find the "unwrapped size" of a list

Body:
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

This is code-golf, so the shortest program (in bytes) wins.

Body:
O, 15 bytes

i~{1\{nJ+}d}J;J

Try it here!

In the input, any commas must be either removed or replaced by spaces.

Explanation

i~{1\{nJ+}d}J;J
i                Read a line of input.
 ~               Evaluate it.
  {        }J;   Define a function and save it into the `J` variable.
                 Currently, the input array is at the top of the stack.
   1\            Push 1 and swap it with the input array.
     {   }d      For each element in the array...
                 Because the array was popped by `d`, 1 is at the TOS.
      nJ+        Recurse and add the result to 1.
              J  Initiate the function call.
                 The result is printed implicitly.

If we're allowed to take work on a string: 10 bytes

ie\']-e@-p


问:
Find the rate of change at a point on a polynomial
Given the equation of a polynomial and an x-coordinate find the rate of change of the point at that x-coord on the curve.

A polynomial is in the form: axn + axn-1 + ... + ax1 + a, where a ϵ Q and n ϵ W. For this challenge, n can also be 0 if you don't want to have to deal with special cases (constants) where there is no x.

To find the rate of change at that x-coord, we can get the derivative of the polynomial and plug in the x-coord.

Input

The polynomial can be taken in any reasonable form, but you must state what that format is explicitly. For example, an array of the form [..[coefficient, exponent]..] is acceptable.

Output

The rate of change of the point at the x-coord given.

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

Examples

```<code>[[4, 3], [-2, 4], [5, 10]]   19    ->   16134384838410
                  [[0, 4]]  400    ->   0
           [[4, 0], [5,1]]  -13    ->   5
      [[4.14, 4], [48, 2]]   -3    ->   -735.12
         [[1, 3], [-5, 0]]    5.4  ->   87.48
</code>```

答:
MATLAB with Symbolic Math Toolbox, 26 bytes

```<code>@(p,x)subs(diff(sym(p)),x)
</code>```

This defines an anonymous function. Inputs are:

a string p defining the polynomial, in the format '4*x^3-2*x^4+5*x^10'

a number x

Example use:

```<code>>> f = @(p,x)subs(diff(sym(p)),x)
f =
    @(p,x)subs(diff(sym(p)),x)

>> f('4*x^3-2*x^4+5*x^10', 19)
ans =
16134384838410
</code>```

Body:
MATLAB with Symbolic Math Toolbox, 26 bytes

@(p,x)subs(diff(sym(p)),x)

This defines an anonymous function. Inputs are:

a string p defining the polynomial, in the format '4*x^3-2*x^4+5*x^10'

a number x

Example use:

>> f = @(p,x)subs(diff(sym(p)),x)
f =
    @(p,x)subs(diff(sym(p)),x)

>> f('4*x^3-2*x^4+5*x^10', 19)
ans =
16134384838410


答:
Julia, <s>45</s> <s>42</s> <s>40</s> 37 bytes

f(p,x)=sum(i->prod(i)x^abs(i[2]-1),p)
```

This is a function that acceps a vector of tuples and a number and returns a number. The absolute value is to ensure that the exponent isn't negative, which necessary because Julia annoying throws a DomainError when raising an integer to a negative exponent.

Try it online! (includes all test cases)

Thanks to Glen O for a couple of corrections and bytes.

Title: Find the rate of change at a point on a polynomial

Body:
Given the equation of a polynomial and an x-coordinate find the rate of change of the point at that x-coord on the curve.

A polynomial is in the form: axn + axn-1 + ... + ax1 + a, where a ϵ Q and n ϵ W. For this challenge, n can also be 0 if you don't want to have to deal with special cases (constants) where there is no x.

To find the rate of change at that x-coord, we can get the derivative of the polynomial and plug in the x-coord.

Input

The polynomial can be taken in any reasonable form, but you must state what that format is explicitly. For example, an array of the form [..[coefficient, exponent]..] is acceptable.

Output

The rate of change of the point at the x-coord given.

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

Examples

```<code>[[4, 3], [-2, 4], [5, 10]]   19    ->   16134384838410
                  [[0, 4]]  400    ->   0
           [[4, 0], [5,1]]  -13    ->   5
      [[4.14, 4], [48, 2]]   -3    ->   -735.12
         [[1, 3], [-5, 0]]    5.4  ->   87.48
</code>```

Body:
Julia, <s>45</s> <s>42</s> <s>40</s> 37 bytes

f(p,x)=sum(i->prod(i)x^abs(i[2]-1),p)

This is a function that acceps a vector of tuples and a number and returns a number. The absolute value is to ensure that the exponent isn't negative, which necessary because Julia annoying throws a DomainError when raising an integer to a negative exponent.

Try it online! (includes all test cases)

Thanks to Glen O for a couple of corrections and bytes.


答:
Matlab, 27 bytes

This is an anonymous function that accepts a value x and a polyonmial p in the form of a list of coefficients, e.g. x^2 + 2 can be represented as [1,0,2].

```<code>@(x,p)polyval(polyder(p),x)
</code>```

Body:
Matlab, 27 bytes

This is an anonymous function that accepts a value x and a polyonmial p in the form of a list of coefficients, e.g. x^2 + 2 can be represented as [1,0,2].

@(x,p)polyval(polyder(p),x)


答:
05AB1E, 12 11 bytes

Saved one byte thanks to Adnan.

```<code>vy¤<²smsP*O

v          For each [coefficient, power] in the input array
 y         Push [coefficient, power]
  ¤<       Compute (power-1)
   ²       Push x value (second input entry)
    sms    Push pow(x, power-1)
       P   Push coefficient * power ( = coefficient of derivative)
        *  Push coefficient * power * pow(x, power-1)
         O Sum everything and implicitly display the result
</code>```

Try it online!

Floating point precision is Python's. I currently swap stack values twice, maybe there is a way to avoid it and save some bytes.

Body:
05AB1E, 12 11 bytes

Saved one byte thanks to Adnan.

vy¤<²smsP*O

v          For each [coefficient, power] in the input array
 y         Push [coefficient, power]
  ¤<       Compute (power-1)
   ²       Push x value (second input entry)
    sms    Push pow(x, power-1)
       P   Push coefficient * power ( = coefficient of derivative)
        *  Push coefficient * power * pow(x, power-1)
         O Sum everything and implicitly display the result

Try it online!

Floating point precision is Python's. I currently swap stack values twice, maybe there is a way to avoid it and save some bytes.


答:
MATL, <s>8</s> 6 bytes

```<code>yq^**s
</code>```

Input is: array of exponents, number, array of coefficients.

Try it online! Or verify all test cases: 1, 2 3, 4, 5.

Explanation

Consider example inputs [3 4 10], 19, [4 -2 5].

```<code>y    % Take first two inputs implicitly and duplicate the first
     %   STACK: [3 4 10], 19, [3 4 10]
q    % Subtract 1, element-wise
     %   STACK: [3 4 10], 19, [2 3 9]
^    % Power, element-wise
     %   STACK: [3 4 10], [361 6859 322687697779]
*    % Multiply, element-wise
     %   STACK: [1083 27436 3226876977790]
*    % Take third input implicitly and multiply element-wise
     %   STACK: [4332 -54872 16134384888950]
s    % Sum of array
     %   STACK: 16134384838410
</code>```

Body:
MATL, <s>8</s> 6 bytes

yq^**s

Input is: array of exponents, number, array of coefficients.

Try it online! Or verify all test cases: 1, 2 3, 4, 5.

Explanation

Consider example inputs [3 4 10], 19, [4 -2 5].

y    % Take first two inputs implicitly and duplicate the first
     %   STACK: [3 4 10], 19, [3 4 10]
q    % Subtract 1, element-wise
     %   STACK: [3 4 10], 19, [2 3 9]
^    % Power, element-wise
     %   STACK: [3 4 10], [361 6859 322687697779]
*    % Multiply, element-wise
     %   STACK: [1083 27436 3226876977790]
*    % Take third input implicitly and multiply element-wise
     %   STACK: [4332 -54872 16134384888950]
s    % Sum of array
     %   STACK: 16134384838410


答:
05AB1E, 5 bytes, A000012, Safe

```<code>$;$1?
</code>```

Sequence of 1's. Try it online

Intended Solution: Arcyou

```<code>1;$$?
</code>```

Try it online. I couldn't find documentation for this language, so don't have an explanation of how it works exactly.

Title: Polyglot Anagrams Cops' Thread

Body:
05AB1E, 5 bytes, A000012, Safe

$;$1?

Sequence of 1's. Try it online

Intended Solution: Arcyou

1;$$?

Try it online. I couldn't find documentation for this language, so don't have an explanation of how it works exactly.


答:
R, 31 bytes

```<code>function(a,n,x)sum(a*n*x^(n-1))
</code>```

Anonymous function that takes a vector of coefficients a, a vector of exponents n, and an x value.

Body:
R, 31 bytes

function(a,n,x)sum(a*n*x^(n-1))

Anonymous function that takes a vector of coefficients a, a vector of exponents n, and an x value.


答:
Mathematica, 6 bytes

```<code>#'@#2&
</code>```

(Beat THAT, <s>MATL</s> and 05AB1E)

The first argument must be a polynomial, with # as its variable and with & at the end (i.e. a pure function polynomial; e.g. 3 #^2 + # - 7 &). The second argument is the x-coordinate of the point of interest.

Explanation

```<code>#'
</code>```

Take the derivative of the first argument (1 is implied).

```<code>... @#2&
</code>```

Plug in the second argument.

Usage

```<code>#'@#2&[4 #^3 - 2 #^4 + 5 #^10 &, 19] (* The first test case *)
</code>```

16134384838410

Body:
Mathematica, 6 bytes

#'@#2&

(Beat THAT, <s>MATL</s> and 05AB1E)

The first argument must be a polynomial, with # as its variable and with & at the end (i.e. a pure function polynomial; e.g. 3 #^2 + # - 7 &). The second argument is the x-coordinate of the point of interest.

Explanation

#'

Take the derivative of the first argument (1 is implied).

... @#2&

Plug in the second argument.

Usage

#'@#2&[4 #^3 - 2 #^4 + 5 #^10 &, 19] (* The first test case *)

16134384838410


问:
Determine the optimal cruise control options
A cruise control has 3 different options to move the handle to set the speed you want to drive with.

Towards you: Adds 1 speed.

Upwards: Increases speed to the next multiple of 10 (e.g. 20-->30, 32-->40)

Downwards: Decreases speed to the next multiple of 10 (e.g. 20-->10, 32-->30)

Input

2 integers: the first is the starting speed and the second is your desired speed, both non-negative and in any form you like (array, two arguments, etc.)

Task

Determine the optimal way of using the handle to reach the desired speed and print out the moves in the correct order.

Rules

If you have the choice between pulling towards you and going upwards (like from 39 to 40) you can choose either option, but stay with whatever you choose for similar cases

You may use any 3 different (preferably visible) symbols to distinguish between the moves in the output (T, U and D for example).

The symbols can be seperated by new lines, spaces, etc. but don't have to be

Here are some test cases:

```<code>start speed, desired speed  -->  output
30, 40  -->  U
30, 43  -->  UTTT
43, 30  -->  DD
51, 39  -->  DDDTTTTTTTTT
29, 30  -->  T or U
29, 50  -->  TUU or UUU
12, 12  -->
</code>```

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

答:
C, 156 bytes

t,x,y;main(int s,char**a){x=(s=atoi(a[1]))/10,y=(t=atoi(a[2]))/10;if(s^t){for(;y>x;++x)puts("U");for(x+=(s-t>10);x>y;--x)puts("D");for(;t--%10;)puts("T");}}
```
<p>Ungolfed:</p>
<pre class="lang-c prettyprint-override"><code>#include <stdio.h>
#include <stdlib.h>
int t, x, y;
int main(int s, char **a)
{
    x = (s = atoi(a[1])) / 10,
    y = (t = atoi(a[2])) / 10;

    if (s ^ t) {
        for ( ; y > x; ++x)
            puts("U");

        for (x += (s - t > 10) ; x > y; --x)
            puts("D");

        for ( ; t-- % 10; )
            puts("T");
    }
    return 0;
}
</code>```

Body:
C, 156 bytes

t,x,y;main(int s,char**a){x=(s=atoi(a[1]))/10,y=(t=atoi(a[2]))/10;if(s^t){for(;y>x;++x)puts("U");for(x+=(s-t>10);x>y;--x)puts("D");for(;t--%10;)puts("T");}}

Ungolfed:

#include <stdio.h>
#include <stdlib.h>
int t, x, y;
int main(int s, char **a)
{
    x = (s = atoi(a[1])) / 10,
    y = (t = atoi(a[2])) / 10;

    if (s ^ t) {
        for ( ; y > x; ++x)
            puts("U");

        for (x += (s - t > 10) ; x > y; --x)
            puts("D");

        for ( ; t-- % 10; )
            puts("T");
    }
    return 0;
}


答:
Python 3, 41 bytes

6 bytes removed thanks to @AndrasDeak! In fact, this answer is now more his than mine...

Thanks also to @1Darco1 for two corrections!

```<code>lambda A,x:sum(a*b*x**(b-1) for a,b in A)
</code>```

Anonymous function that accepts a list of lists with coefficients and exponents (same format as described in the challenge) and a number.

Try it here.

Body:
Python 3, 41 bytes

6 bytes removed thanks to @AndrasDeak! In fact, this answer is now more his than mine...

Thanks also to @1Darco1 for two corrections!

lambda A,x:sum(a*b*x**(b-1) for a,b in A)

Anonymous function that accepts a list of lists with coefficients and exponents (same format as described in the challenge) and a number.

Try it here.


答:
sh (via base64 and pigz) 59 bytes

```<code>echo eNqLr4mPpxxzgQjKMRc5mkZdM+oaAG7xGAs=|base64 -D|pigz -d
</code>```

Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
sh (via base64 and pigz) 59 bytes

echo eNqLr4mPpxxzgQjKMRc5mkZdM+oaAG7xGAs=|base64 -D|pigz -d


答:
J, 2 bytes, A000290, Cracked

```<code>*~
</code>```

Well, might as well start going for those two-byters. Yields n × n, or n2.

<s>intended solution, Jolf, 2 bytes

```<code>*~
</code>```

Well. Yeah. This is my own language and I think it works because ~ looks for an extended character, but doesn't find one, so it just ignores it. ¯\_(ツ)_/¯</s> Oops.

Title: Polyglot Anagrams Cops' Thread

Body:
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Body:
J, 2 bytes, A000290, Cracked

*~

Well, might as well start going for those two-byters. Yields n × n, or n2.

<s>intended solution, Jolf, 2 bytes

*~

Well. Yeah. This is my own language and I think it works because ~ looks for an extended character, but doesn't find one, so it just ignores it. ¯\_(ツ)_/¯</s> Oops.


答:
JavaScript (ES7), 40 bytes

```<code>(a,n)=>a.reduce((t,c,i)=>t+i*c*n**--i,0)
</code>```

a is an array of the coefficients in ascending exponent order with zeros included e.g. x³-5 would be represented by [-5, 0, 0, 1].

Body:
JavaScript (ES7), 40 bytes

(a,n)=>a.reduce((t,c,i)=>t+i*c*n**--i,0)

a is an array of the coefficients in ascending exponent order with zeros included e.g. x³-5 would be represented by [-5, 0, 0, 1].


答:
2sable, Conor O'Brien, A000290

```<code>~*
</code>```

Try it online!

I don't know how it works, there's really only one program that meets the requirements and I just brute-forced to find the language it worked in.

After looking through the docs, I am able to come up with an explanation:

```<code>~         Push Input OR Input (always pushes the input)
 *        Multiply that by Input
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

Body:
2sable, Conor O'Brien, A000290

~*

Try it online!

I don't know how it works, there's really only one program that meets the requirements and I just brute-forced to find the language it worked in.

After looking through the docs, I am able to come up with an explanation:

~         Push Input OR Input (always pushes the input)
 *        Multiply that by Input


答:
<s>ABCR, 24 bytes, A023443</s> Cracked!

```<code>70: Quit xi. Classy queue!
</code>```

There's a bunch of no-ops.  Calculates n - 1.

Title: Polyglot Anagrams Cops' Thread

Body:
<s>ABCR, 24 bytes, A023443</s> Cracked!

70: Quit xi. Classy queue!

There's a bunch of no-ops.  Calculates n - 1.


答:
Dyalog APL, <s>26</s> <s>25</s> 23 bytes

```<code>{a←⍺⋄+/{×/⍵×a*2⌷⍵-1}¨⍵}
</code>```

Takes polynomial as right argument and value as left argument.

Body:
Given the equation of a polynomial and an x-coordinate find the rate of change of the point at that x-coord on the curve.

A polynomial is in the form: axn + axn-1 + ... + ax1 + a, where a ϵ Q and n ϵ W. For this challenge, n can also be 0 if you don't want to have to deal with special cases (constants) where there is no x.

To find the rate of change at that x-coord, we can get the derivative of the polynomial and plug in the x-coord.

Input

The polynomial can be taken in any reasonable form, but you must state what that format is explicitly. For example, an array of the form [..[coefficient, exponent]..] is acceptable.

Output

The rate of change of the point at the x-coord given.

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

Examples

```<code>[[4, 3], [-2, 4], [5, 10]]   19    ->   16134384838410
                  [[0, 4]]  400    ->   0
           [[4, 0], [5,1]]  -13    ->   5
      [[4.14, 4], [48, 2]]   -3    ->   -735.12
         [[1, 3], [-5, 0]]    5.4  ->   87.48
</code>```

Body:
Dyalog APL, <s>26</s> <s>25</s> 23 bytes

{a←⍺⋄+/{×/⍵×a*2⌷⍵-1}¨⍵}

Takes polynomial as right argument and value as left argument.


Body:
DASH, 33 bytes

@@sum(->@* ^#1- :1#0 1(sS *)#0)#1

Usage:

(
  (
    @@sum(->@* ^#1- :1#0 1(sS *)#0)#1
  ) [[4;3];[_2;4];[5;10]]
) 19

Explanation

@@                             #. Curried 2-arg lambda
                               #. 1st arg -> X, 2nd arg -> Y
  sum                          #. Sum the following list:
    (map @                     #. Map over X
                               #. item list -> [A;B]
      * ^ #1 - :1#0 1(sS *)#0  #. This mess is just A*B*Y^(B-1)
    )#1                        #. X


答:
 Befunge 93, 14 bytes, A121377,  Cracked by milk!

```<code>&52* %68*+ .@Q
</code>```

Fun fact: The intended solution to this is the first time I've ever used that language.

My solution in Pyth. &@ print an error, but that goes to STDERR which according to the OP is ignored.

```<code>+%Q*5 2*6 8.&@
</code>```

Title: Polyglot Anagrams Cops' Thread

Body:
 Befunge 93, 14 bytes, A121377,  Cracked by milk!

&52* %68*+ .@Q

Fun fact: The intended solution to this is the first time I've ever used that language.

My solution in Pyth. &@ print an error, but that goes to STDERR which according to the OP is ignored.

+%Q*5 2*6 8.&@


问:
Write a Polyquine
A polyquine is both quine and polyglot.1 You are to write a quine which is valid in at least two different languages. This is code golf, so the shortest answer (in bytes) wins.

1 I made that up. Or rather, Geobits did. Apparently, he wasn't the first one either, though.

Rules for Quines

Only true quines are accepted. That is, you need to print the entire source code verbatim to STDOUT, without:

reading your source code, directly or indirectly.

relying on a REPL environment which just simply evaluates and prints every expression you feed it.

relying on language features which just print out the source in certain cases.

using error messages or STDERR to write all or part of the quine. (You may write things to STDERR or produce warnings/non-fatal errors as long as STDOUT is a valid quine and the error messages are not part of it.)

Furthermore, your code must contain a string literal.

Rules for Polyglots

The two languages used must be distinctly different. In particular:

They must not be different versions of the same language (e.g. Python 2 vs. Python 3).

They must not be different dialects of the same language (e.g. Pascal vs. Delphi).

One language may not be a subset of the other one (e.g. C vs. C++).

答:
05AB1E/2sable, 14 bytes, non-competing

```<code>0"D34çý"D34çý
</code>```

Try it online! (05AB1E)

Try it online! (2sable)

2sable is derived from 05AB1E and is similar, but has major differences.

Trailing newline.

Title: Write a Polyquine

Body:
05AB1E/2sable, 14 bytes, non-competing

0"D34çý"D34çý

Try it online! (05AB1E)

Try it online! (2sable)

2sable is derived from 05AB1E and is similar, but has major differences.

Trailing newline.


答:
DASH, 14 bytes

```<code>(ss[len;!> ="]
</code>```

Simply counts ]'s. Usage:

```<code>(ss[len;!> ="]"])"[[]]"
</code>```

Bonus solution, 15 bytes

```<code>a\@+1sum ->#a#0
</code>```

This one recursively counts from a real list. Usage:

```<code>(f\@+1sum ->#f#0)[[]]
</code>```

Title: Find the "unwrapped size" of a list

Body:
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

This is code-golf, so the shortest program (in bytes) wins.

Body:
DASH, 14 bytes

(ss[len;!> ="]

Simply counts ]'s. Usage:

(ss[len;!> ="]"])"[[]]"

Bonus solution, 15 bytes

a\@+1sum ->#a#0

This one recursively counts from a real list. Usage:

(f\@+1sum ->#f#0)[[]]


答:
Regex, 1 byte

```<code>]
</code>```

Try it online!

Title: Find the "unwrapped size" of a list

Body:
Regex, 1 byte

]

Try it online!


问:
Pairable strings
A string is pairable if it can be split into subtrings, each of which is a string repeated twice consecutively. For example, aabaaababbbaba is pairable as:

```<code>aaba aaba
b b
ba ba
</code>```

Given a non-empty string of a's and b's, output a Truthy value if it's pairable and a Falsey value if it isn't.

Pairable:

```<code>aa
abaaba
bbababbb
aabaaababbbaba
babababa
bbbbbbbbbbbb
aaababbabbabbbababbaabaabaababaaba
aaaabaab
</code>```

Not pairable:

```<code>a
ba
baab
abaabaaba
bbbbbbbbbbbbbbb
baababbabaaaab
aaaaabbaaaaa
</code>```

I encourage you to come up with non-regex-based solutions even when there's already a shorter regex answer in your language. You can mark them as "no regex". By regex, I mean a built-in string pattern matching subsystem.

Leaderboard:

var QUESTION_ID=98252,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/98252/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Python 2, 60 bytes

```<code>f=lambda s,t='':''<s>f(s[1:],t+s[0])|f(t and s)*f(t)>-(s==t)
</code>```

I hope this is correct. It runs pretty slowly and the and doesn't look optimal.

Title: Pairable strings

Body:
Python 2, 60 bytes

f=lambda s,t='':''<s>f(s[1:],t+s[0])|f(t and s)*f(t)>-(s==t)

I hope this is correct. It runs pretty slowly and the and doesn't look optimal.


答:
05AB1E, 4 bytes, Oliver, A000012

```<code>p¥_1
</code>```

Try it online!

This is a sequence of 1s.

```<code>              # Implicit input
p¥_           # Does nothing
   1          # Pushes 1 to the stack
              # Implicit output
</code>```

This outputs 1 no matter what the input is.

Title: Polyglot Anagrams Robbers' Thread

Body:
05AB1E, 4 bytes, Oliver, A000012

p¥_1

Try it online!

This is a sequence of 1s.

              # Implicit input
p¥_           # Does nothing
   1          # Pushes 1 to the stack
              # Implicit output

This outputs 1 no matter what the input is.


答:
Pyth, 26 bytes, Steven H., A023443

Code:

```<code>tQ.qly 7:esau0euii s uxC !
</code>```

Try online.

Fairly simple:

```<code> Q                            Reads input
t                             Substracts 1 from it
  .q                          Quits program (implicit print)
    ly 7:esau0euii s uxC !    None of this ever plays a part...
                                I just thought it'd be fun to scramble it.
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
Pyth, 26 bytes, Steven H., A023443

Code:

tQ.qly 7:esau0euii s uxC !

Try online.

Fairly simple:

 Q                            Reads input
t                             Substracts 1 from it
  .q                          Quits program (implicit print)
    ly 7:esau0euii s uxC !    None of this ever plays a part...
                                I just thought it'd be fun to scramble it.


答:
Python 3, 118 bytes, ETHproductions, A042545

s,a=801**.5-28,[0,0==0]
for i in range(int(input())):a+=[a[i]+a[-1]*int(1/s)];s=1/s-1//s
(print(a[-2]),) #.0fhlmop|
```

<p>Test it on Ideone.</p>

<h3>Cop submission</h3>

<pre class="lang-python prettyprint-override"><code>i=input();s=1/(801**.5-28);a=[0,1]
for p in range(i):a+=[a[-2]+a[-1]*int(s)];s=1/(s-int(s))
print a[i]#,,,.//000fhlmo|
</code>```

What's different

The cop submission doesn't work in Python 3 for two reasons.

Python 2's input function automatically evals one line of input, while Python 3's counterpart just returns the line as a string. We can simply call int to fix this.

print was a statement in Python 2, but it is a function in Python 3. In particular, that means that we have to surround its argument with parentheses.

That means we need int() and (), but those characters aren't all part of the comment. That means we must make some changes.

Instead of the fraction s, we keep track of 1/s.

The initialization of s – s=1/(801**.5-28) – becomes s=801**.5-28, saving the characters 1/().

The factor of a[-1] in the update of a – int(s) – becomes int(1/s), costing the characters 1/.

The update of s – s=1/(s-int(s)) – becomes s=1/s-1//s, costing the characters 1//, but saving the characters (int()).

The saved characters in ()(int()) cover those we needed to port the code to Python 3, but obtaining them cost us 1//. We can take // from the comment, but we'll have to save 1 elsewhere.

One way (the only one?) of saving the needed 1 is to replace the 1 in the initialization of a with 0==0. This costs those four characters, but we can take 00 from the comment.

So far, we have the following code.

i=int(input());s=801**.5-28;a=[0,0==0]
for p in range(i):a+=[a[-2]+a[-1]*int(1/s)];s=1/s-1//s
print(a[i]) #,,,.()0fhlmo|
```

<p>To recover one of the <code>=</code> we now "owe", we can rewrite the initialization of <strong>s</strong> and <strong>a</strong> with a single assignment: <code>s,a=801**.5-28,[0,0==0]</code> Additionally, this saves a <code>;</code> and costs a <code>,</code>, which can be be added to and removed from the comment.</p>

<p>The second <code>=</code> can be saved by not storing the input in a variable, i.e., writing <code>range(int(input()))</code> instead, saving the characters in <code>i=</code>. We use <strong>i</strong> after the loop as well, but the <strong>i</strong><sup>th</sup> element of <strong>a</strong> is just the second one from the right, so we can replace <code>i</code> with <code>-2</code>. For the same reason, <code>a[-2]</code> in the loop body can be replaced with <code>i</code>.</p>

<p>We now have a permutation into working Python 3 code:</p>

<pre class="lang-python prettyprint-override"><code>s,a=801**.5-28,[0,0==0]
for i in range(int(input())):a+=[a[i]+a[-1]*int(1/s)];s=1/s-1//s
print(a[-2]) #,.()0fhlmop|
</code>```

However, this code also works in Python 2! One way of fixing this is to replace print(a[-2]) with (print(a[-2]),); we have the characters we need in the comment. As mentioned before, print is a function in Python 3, so this constructs the tuple (None,). However, Python 2's print statement is a SyntaxError inside a tuple literal.

Title: Polyglot Anagrams Robbers' Thread

Body:
Python 3, 118 bytes, ETHproductions, A042545

s,a=801**.5-28,[0,0==0]
for i in range(int(input())):a+=[a[i]+a[-1]*int(1/s)];s=1/s-1//s
(print(a[-2]),) #.0fhlmop|

Test it on Ideone.

Cop submission

i=input();s=1/(801**.5-28);a=[0,1]
for p in range(i):a+=[a[-2]+a[-1]*int(s)];s=1/(s-int(s))
print a[i]#,,,.//000fhlmo|

What's different

The cop submission doesn't work in Python 3 for two reasons.

Python 2's input function automatically evals one line of input, while Python 3's counterpart just returns the line as a string. We can simply call int to fix this.

print was a statement in Python 2, but it is a function in Python 3. In particular, that means that we have to surround its argument with parentheses.

That means we need int() and (), but those characters aren't all part of the comment. That means we must make some changes.

Instead of the fraction s, we keep track of 1/s.

The initialization of s – s=1/(801**.5-28) – becomes s=801**.5-28, saving the characters 1/().

The factor of a[-1] in the update of a – int(s) – becomes int(1/s), costing the characters 1/.

The update of s – s=1/(s-int(s)) – becomes s=1/s-1//s, costing the characters 1//, but saving the characters (int()).

The saved characters in ()(int()) cover those we needed to port the code to Python 3, but obtaining them cost us 1//. We can take // from the comment, but we'll have to save 1 elsewhere.

One way (the only one?) of saving the needed 1 is to replace the 1 in the initialization of a with 0==0. This costs those four characters, but we can take 00 from the comment.

So far, we have the following code.

i=int(input());s=801**.5-28;a=[0,0==0]
for p in range(i):a+=[a[-2]+a[-1]*int(1/s)];s=1/s-1//s
print(a[i]) #,,,.()0fhlmo|

To recover one of the = we now "owe", we can rewrite the initialization of s and a with a single assignment: s,a=801**.5-28,[0,0==0] Additionally, this saves a ; and costs a ,, which can be be added to and removed from the comment.

The second = can be saved by not storing the input in a variable, i.e., writing range(int(input())) instead, saving the characters in i=. We use i after the loop as well, but the ith element of a is just the second one from the right, so we can replace i with -2. For the same reason, a[-2] in the loop body can be replaced with i.

We now have a permutation into working Python 3 code:

s,a=801**.5-28,[0,0==0]
for i in range(int(input())):a+=[a[i]+a[-1]*int(1/s)];s=1/s-1//s
print(a[-2]) #,.()0fhlmop|

However, this code also works in Python 2! One way of fixing this is to replace print(a[-2]) with (print(a[-2]),); we have the characters we need in the comment. As mentioned before, print is a function in Python 3, so this constructs the tuple (None,). However, Python 2's print statement is a SyntaxError inside a tuple literal.


问:
Program that creates larger versions of itself (quine-variant)
You are to write a program that will output source code that is

Larger than the original program (character wise)

Will print another program larger than itself when run (i.e. the new program is also a valid answer to this challenge) indefinitely

This is code-golf, so shortest answer wins.

答:
05AB1E, 15 bytes, noncompeting

```<code>0"DÐ34çý"DÐ34çý
</code>```

Try it online!

Prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,

which prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,

etc.

Body:
05AB1E, 15 bytes, noncompeting

0"DÐ34çý"DÐ34çý

Try it online!

Prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,

which prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,

etc.


答:
2sable, 14 bytes, Dopapp, A121377

```<code>Q@5 2*%6 8*+.&
</code>```

Try it online.

How it works (more or less):

```<code>Q@
  5              # Push 5
    2            # Push 2
     *           # Pop (2), pop (5), push 5*2=10
      %          # Pop (10), pop (input), push input%10
       6         # Push 6
         8       # Push 8
          *      # Pop (8), pop (6), push 8*6=48
           +     # Pop (48), pop (input), push input+48
            .&
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
2sable, 14 bytes, Dopapp, A121377

Q@5 2*%6 8*+.&

Try it online.

How it works (more or less):

Q@
  5              # Push 5
    2            # Push 2
     *           # Pop (2), pop (5), push 5*2=10
      %          # Pop (10), pop (input), push input%10
       6         # Push 6
         8       # Push 8
          *      # Pop (8), pop (6), push 8*6=48
           +     # Pop (48), pop (input), push input+48
            .&


问:
Obfuscated FizzBuzz Golf
Create the shortest possible obfuscated FizzBuzz implementation.

To be considered obfuscated, it should satisfy at least one of the following:

Does not contain any of the words "Fizz", "Buzz", or "FizzBuzz"

Does not contain the numbers 3, 5, or 15.

Use any of the above in a misleading way.

Remember: The goal is to be short and hard to follow.

The code sample which inspired this question follows:

```<code>public class Default
{
        enum FizzBuzz
        {
            Buzz = 1,
            Fizz,
            FizzBuzz
        }
        public static void Main(string[] args)
        {
            byte[] foo =
              Convert.FromBase64String("IAmGMEiCIQySYAiDJBjCIAmGMEiCIQySYA==");
            MemoryStream ms = new MemoryStream(foo);
            byte[] myByte = new byte[1];
            do
            {
                FizzBuzz fb;
                ms.Read(myByte, 0, 1);
                for (int i = 0; i < 4; i++)
                {
                    fb = (FizzBuzz)(myByte[0] >> (2 * i)
                         & (int)FizzBuzz.FizzBuzz);
                    Console.Out.WriteLine( (((int)fb > 0) ? "" + fb : ""
                         + ((ms.Position - 1) * 4 + i + 1)));
                }
            } while (ms.Position < ms.Length);
        }
}
</code>```

答:
C++: 886 chars

I've tried to hide the 'fizz' and the 'buzz'. Can you spot them?

```<code>#include <iostream>
#define d(a,b) a b
#define _(a,b) d(#b,#a)
#define b(b) _(b,b)
#define y _(i,f)c
#define x _(u,b)c
#define c b(z)
#define i int
#define p main
#define s char
#define q 810092048
#define h for
#define m 48
#define a ++
#define e ==
#define g 58
#define n 49
#define l <<
#define oe std::cout<<
#define v '\n'

int  p   (i,  s*t     ){i   j  =   q;h   (*(
i    *     )    t     =  m  ;  2     [     t
]?   0    :    1      ??(   t  ]    ?     a
1    [   t    ]       e  g  ?  1   [     t
]    =   48,  ++0     ??(    t]e   g?0   ??(

t]=  n   ,1[  t]=
2    [     t    ]
=m   :    1    :
1    :   a    0
[    t   ??)  ==g

?0[   t  ]   =49   ,1[
t  ]  =  m     :     1
;j=   (  j    /     4
)  |  (  (   j     &
3)l    28)   )oe   (j&

3?j  &   1?j  &2?
y    x     :    y
:x   :    t    )
l    v   ;    }
i    f   =m&  ~g;
</code>```

ContentLicense: CC BY-SA 2.5

Title: Obfuscated FizzBuzz Golf

Body:
C++: 886 chars

I've tried to hide the 'fizz' and the 'buzz'. Can you spot them?

#include <iostream>
#define d(a,b) a b
#define _(a,b) d(#b,#a)
#define b(b) _(b,b)
#define y _(i,f)c
#define x _(u,b)c
#define c b(z)
#define i int
#define p main
#define s char
#define q 810092048
#define h for
#define m 48
#define a ++
#define e ==
#define g 58
#define n 49
#define l <<
#define oe std::cout<<
#define v '\n'

int  p   (i,  s*t     ){i   j  =   q;h   (*(
i    *     )    t     =  m  ;  2     [     t
]?   0    :    1      ??(   t  ]    ?     a
1    [   t    ]       e  g  ?  1   [     t
]    =   48,  ++0     ??(    t]e   g?0   ??(

t]=  n   ,1[  t]=
2    [     t    ]
=m   :    1    :
1    :   a    0
[    t   ??)  ==g

?0[   t  ]   =49   ,1[
t  ]  =  m     :     1
;j=   (  j    /     4
)  |  (  (   j     &
3)l    28)   )oe   (j&

3?j  &   1?j  &2?
y    x     :    y
:x   :    t    )
l    v   ;    }
i    f   =m&  ~g;


答:
Scala, 46 bytes

```<code>s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum
</code>```

Usage:

```<code>val f:(Seq[(Double,Double)]=>Double=>Double)=
  s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum
print(f(Seq(4.0 → 3, -2.0 → 4, 5.0 → 10))(19))
</code>```

Explanation:

```<code>s=>                        //define an anonymous function with a parameter s returning
  i=>                        //an anonymous function taking a paramater i and returning
    s map{                   //map each element of s:
      case(c,e)=>              //unpack the tuple and call the values c and e
        c*e*math.pow(i,e-1)    //calculate the value of the first derivate
    }sum                      //take the sum
</code>```

Body:
Scala, 46 bytes

s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum

Usage:

val f:(Seq[(Double,Double)]=>Double=>Double)=
  s=>i=>s map{case(c,e)=>c*e*math.pow(i,e-1)}sum
print(f(Seq(4.0 → 3, -2.0 → 4, 5.0 → 10))(19))

Explanation:

s=>                        //define an anonymous function with a parameter s returning
  i=>                        //an anonymous function taking a paramater i and returning
    s map{                   //map each element of s:
      case(c,e)=>              //unpack the tuple and call the values c and e
        c*e*math.pow(i,e-1)    //calculate the value of the first derivate
    }sum                      //take the sum


Body:
Haskell, 33 bytes

f x=sum.map(\[c,e]->c*e*x**(e-1))

Usage:

> f 5.4 [[1, 3], [-5, 0]]
87.48000000000002


答:
CJam, 27 bytes

```<code>l~_])\z_,*f{{_2$&,*|}/:e>}p
</code>```

Try it online! Test suite.

Explanation

```<code>l~       e# Read and evaluate input, dumping arrays A and B on the stack.
_        e# Copy B.
])\      e# Wrap in array, pull off B, swap. Gives B [A B] on the stack.
z        e# Transpose the [A B] matrix to get a list of all equivalent pairs.
_,*      e# Repeat this list by the number of pairs. This is to ensure that the
         e# following procedure is applied often enough to allow transitive
         e# equivalences to propagate.
f{       e# Map this block over B, passing in the list of pairs each time...
  {      e#   For each pair...
    _2$  e#     Copy both the pair and the current value/list.
    &,   e#     Get the length of their intersection. If this is non-zero,
         e#     the current pair belongs to the current equivalence class.
    *    e#     Repeat the pair that many times.
    |    e#     Set union between the current value/list and the repeated pair.
         e#     This adds the pair to the current list iff that list already
         e#     contains one value from the pair.
  }/
  :e>    e#   Get the maximum value of this equivalence class.
}
p        e# Pretty print.
</code>```

Title: Array unification

Body:
Introduction

Consider two arrays of the same length, say A = [0,1,0,2] and B = [-1,1,2,2].
Suppose we know that their contents are equivalent in some sense, item by item:

0 is equivalent to -1,

1 is equivalent to 1,

0 is equivalent to 2, and

2 is equivalent to 2.

Equivalence is transitive: -1 and 0 are equivalent, and 0 and 2 are equivalent, so -1 and 2 are also equivalent.
The unification of A and B is the array where each item of A (or B) has been replaced by the largest number that's equivalent to it.
In this case, the unification would be [2,1,2,2].

The task

Write a program or function that takes two non-empty integer arrays of equal length, and outputs their unification. You can also modify one of the inputs in place instead of returning.
The lowest byte count wins.

Test cases

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

Body:
CJam, 27 bytes

l~_])\z_,*f{{_2$&,*|}/:e>}p

Try it online! <a href="http://cjam.tryitonline.net/#code=cU4veyItPiIvUyp-OlI7XTpgUyo6TDsKCkx-X10pXHpfLCpme3tfMiQmLCp8fS86ZT59CgpSPW99Lw&input=WzBdIFswXSAtPiBbMF0KWzFdIFsyXSAtPiBbMl0KWzAgMSAwXSBbMiAxIDBdIC0-IFsyIDEgMl0KWzEgMiAzXSBbMCAwIDFdIC0-IFszIDMgM10KWzAgMSAwIDJdIFstMSAxIDIgMl0gLT4gWzIgMSAyIDJdClsxIDAgMSAtNF0gWy0zIC0xIC0yIDJdIC0-IFsxIDAgMSAyXQpbMSAyIDMgLTJdIFsxIDAgLTMgLTJdIC0-IFsxIDIgMyAtMl0KWy0zIC0yIC0xIDAgMV0gWy0xIC0xIC0xIC0xIC0xXSAtPiBbMSAxIDEgMSAxXQpbLTMgLTIgLTEgMCAxXSBbMiAtMSAwIDEgLTNdIC0-IFsyIDIgMiAyIDJdClstMyA1IDUgMyAxXSBbNCAyIDMgMSAyXSAtPiBbNCA1IDUgNSA1XQpbNCAwIDIgLTUgMF0gWzAgNCAtNSAzIDVdIC0-IFs1IDUgMyAzIDVdClstMiA0IC0yIDMgMiA0IDEgMV0gWy0yIDQgMSAyIDIgMyAxIC0yXSAtPiBbMSA0IDEgNCA0IDQgMSAxXQpbLTEwIC0yMCAtMTEgMTIgLTE4IDE0IC04IC0xIC0xNCAxNSAtMTcgMTggMTggLTYgMyAxIDE1IC0xNSAtMTkgLTE5XSBbLTEzIDYgLTQgMyAxOSAxIC0xMCAtMTUgLTE1IDExIDYgOSAtMTEgMTggNiA2IC01IC0xNSA3IC0xMV0gLT4gWy04IDE0IDE4IDE0IDE5IDE0IC04IC0xIC0xIDE1IDE0IDE4IDE4IDE4IDE0IDE0IDE1IC0xIDE4IDE4XQpbMjAgMTUgMiA0IC0xMCAtNCAtMTkgMTUgLTUgMiAxMyAtMyAtMTggLTUgLTYgMCAzIC02IDMgLTE3XSBbLTE4IDcgNiAxOSAtOCAtNCAtMTYgLTEgMTMgLTE4IDggOCAtMTYgMTcgLTkgMTQgLTIgLTEyIDcgNl0gLT4gWzIwIDE1IDIwIDE5IC04IC00IDIwIDE1IDE3IDIwIDE3IDE3IDIwIDE3IC02IDE0IDE1IC02IDE1IDIwXQ" rel="nofollow noreferrer">Test suite.

Explanation

l~       e# Read and evaluate input, dumping arrays A and B on the stack.
_        e# Copy B.
])\      e# Wrap in array, pull off B, swap. Gives B [A B] on the stack.
z        e# Transpose the [A B] matrix to get a list of all equivalent pairs.
_,*      e# Repeat this list by the number of pairs. This is to ensure that the
         e# following procedure is applied often enough to allow transitive
         e# equivalences to propagate.
f{       e# Map this block over B, passing in the list of pairs each time...
  {      e#   For each pair...
    _2$  e#     Copy both the pair and the current value/list.
    &,   e#     Get the length of their intersection. If this is non-zero,
         e#     the current pair belongs to the current equivalence class.
    *    e#     Repeat the pair that many times.
    |    e#     Set union between the current value/list and the repeated pair.
         e#     This adds the pair to the current list iff that list already
         e#     contains one value from the pair.
  }/
  :e>    e#   Get the maximum value of this equivalence class.
}
p        e# Pretty print.