ZOJ在建站105个月之后迎来了第一百场比赛。

””\\(￣ー￣) (￣ー￣)//””

Let’s Celebrate the 100th Contest on ZOJ!
100A ZOJ3437 Very Hard Problem 6.89% (28/406)
100B ZOJ3438 Tripartite Graph 62.28% (71/114)
100C ZOJ3439 Substitution Cipher 7.86% (36/458)
100D ZOJ3440 Detect the Virus II 0.00% (0/26)
100E ZOJ3441 Crack Me II 2.06% (2/97)
100F ZOJ3442 Complex Calculator 0.00% (0/1)
100G ZOJ3443 Bessel Function II 0.00% (0/0)
100H ZOJ3444 An Unusual Problem 5.12% (2/39)
100I ZOJ3445 1KB 9.09% (4/44)

### ZOJ3437. Very Hard Problem

[C (programming language), yet-another-easy-problem]

### ZOJ3438. Tripartite Graph

[yet-another-easy-problem]

### ZOJ3439. Substitution Cipher

[C (programming language), puzzle, yet-another-easy-problem]

This is a problem about Substitution Cipher. All letters from a to z are mapped to a permutation of themselves, which means that it is a bijection. You should try to decrypt the description. But what you should submit is the program that encrypt this descrption. The test input just contains all one-byte characters.

To make it easier to decrypt, part of wiki page of Substitution Cipher is quoted.

In cryptography, a substitution cipher is a method of encryption …

“看懂”题目是成功的一半。其实标题的提示性就很强了，而且加密也很弱。不过这只是一半而已，首先要注意的第一个地方是 what you should submit is the program that encrypt this descrption，sample特别选得对加密和解密是对称的。然后就是 The test input just contains all one-byte characters，所以0-255的字符都出现了。需要注意的是，如果你是

```for (int i = 0; i < 256; ++i) charmap[i] = i;
```

```char ch;
while ((ch = getchar()) != EOF) {
}
```

fgetc(), getc() and getchar() return the character read as an unsigned char cast to an int or EOF on end of file or error.

### ZOJ3445. 1KB

[BigInt]

Perl的Math::BigInt中直接提供有bsqrt函数，所以是最省事的，不过我的程序也是最慢的。顺带一提，Math::BigInt还提供了bnok函数直接求c[n][k]，可惜这个函数有bug

There is a bug in Math::BigInt’s implementation of n over k:
Math::BigInt->new(\$n)->bnok(0) is \$n+1, should be 1.
Math::BigInt->new(\$n)->bnok(\$n-1) is 1, should be \$n.

TO BE CONTINUED …

11 Responses to “[题解]Let’s Celebrate the 100th Contest on ZOJ!”
1. LambdaTT says:

请问ZOJ里用Scheme提交的格式是什么样的?
或者能给出A+B Problem的Scheme代码吗?

• watashi says:
```(define gao
(lambda (a b)
(if (eof-object? a)
0
(begin
(display (+ a b))
(newline)
)
)
)
)

```
2. jing says:

1kb那个也太夸张了吧，居然还加个1kb，够非主流的

3. LCLL says:

char ch;
while ((char = getchar()) != EOF) {
}

打错了吧～
ch = getchar() ?

• watashi says:

……居然被圡王指出来了……

4. 小媛 says:

表示压力很大啊压力很大。。。不过感觉这次题很有意思。。。对解密那题很有兴趣。。。BTW：这次比赛的题真是太灰主流了 = =

• watashi says:

因为非主流，所以没有安排成月赛

5. Navi says:

ym

• watashi says:

你看，都掉到你出的两题坑里了，好玩的题都无人问津了……

• Navi says:

坑就是让人来跳的…

6.