### ZOJ3441. Crack Me II

[cpp + indent, sorting, set_difference]

```cpp ZOJ3441txt.c > ZOJ3441cpp.c
```

```indent ZOJ3441cpp.c
```

### Perl: Math::BigInt

Math::BigInt提供了非常多方法，而且很多方法也有对应的运算符重载，支持bin, oct, dec, hex格式字符串与BigInt之间的相互转化，几乎没有不支持的操作，包括三角函数，二项式系数都有。不过Math::BigInt有很多不同的实现，其中最快的是Math::BigInt::GMP，效果还是非常理想的，但是默认的Math::BigInt::Calc就慢得不能忍了，远比php, java, ruby, python的都要慢。另外Math::BigFloat是基于Math::BigInt的高精度浮点数。

```use Math::BigInt lib => 'GMP';
use Math::BigFloat try => 'GMP';
print Math::BigFloat->bpi(64), "\n"; # 3.14...
my \$x = new Math::BigInt('0x123456789abcdef');
my \$y = Math::BigInt->new('0b101010101010101');
print \$x + \$y, "\n";
print join(":", \$x->copy()->bdiv(\$y)), "\n";
```

### Bash: bc

```#!/usr/bin/bc -q

define e(n) {
auto i, p, s;
p = 10 ^ n;
s = 2 * p;
for (i = 2; p > 0; ++i) {
p /= i;
s += p;
}
return s;
}

print "input a integer: "
e(x)
quit

# input a integer: 40
# 27182818284590452353602874713526624977552
```

### Php: BCMath

bc是Binary Calculator的

SPOJ24. Small factorials[FCTRL2]就是阶乘计算加高精度运算。以下是用内置大数支持的perl, php, java, ruby, python, haskell, bash, scheme等语言实现的代码。

```main = interact \$ unlines . map (\i -> show \$ f !! read i) . tail . words
where f = scanl (*) 1 [1 ..]
```

### perl

```#!/usr/bin/perl -w

use strict;
use Math::BigInt lib => 'GMP';

my @f = ();
push @f, Math::BigInt->new(1);
for (my \$i = 1; \$i <= 100; ++\$i) {
push @f, \$f[\$#f]->copy()->bmul(\$i);
}
chomp(my \$re = <STDIN>);
for (my \$ri = 1; \$ri <= \$re; ++\$ri) {
chomp(my \$n = <STDIN>);
print "\$f[\$n]\n";
}
```

### php

As I cannot find any appropriate haskell brushes for SyntaxHighlighter, I developed one by myself. You can download it here, I do hope it will be helpful. If you find any bugs or have any suggestions, please comment here or email me.

1. 在一堆wp_register_script中间插入一句
```/* register my brush */
```
2. 再添加映射

```\$this->brushes = (array) apply_filters( 'syntaxhighlighter_brushes', array(
/* ... */
) );
```
3. 大功告成。

```main = do
input <- getContents
putStr \$ unlines \$ map show \$ doEMP \$ map read \$ words input

doEMP [] = []
doEMP (a:b:o) = a + b : doEMP o
```