Andrew Stankevich’s Contest #1
ZOJ2313 Chinese Girls’ Amusement 34.16% (233/682)
ZOJ2314 Reactor Cooling 26.61% (297/1116)
ZOJ2315 New Year Bonus Grant 35.25% (239/678)
ZOJ2316 Matrix Multiplication 44.19% (293/663)
ZOJ2317 Nice Patterns Strike Back 24.05% (115/478)
ZOJ2318 Get Out! 19.91% (94/472)
ZOJ2319 Beautiful People 26.34% (254/964)
ZOJ2320 Cracking’ RSA 31.41% (82/261)

### ZOJ2313 Chinese Girls’ Amusement

source code (ZOJ2313.cpp) [number theory]

### ZOJ2314 Reactor Cooling

source code (ZOJ2314.java) [FlowNetwork, 上下界最大流]

### ZOJ2315 New Year Bonus Grant

source code (ZOJ2315.java) [graph, greedy]

### ZOJ2316 Matrix Multiplication

source code (ZOJ2316.c) [graph, math]

A是图G的关联矩阵，求B=ATA的元素和。

$ans=\sum_{i,j}{B_{ij}}=\sum_{i,j}\sum_k{A_{ki}A_{kj}}=\sum_k\sum_{i,j}{{A_{ki}A_{kj}}}=\sum_{k=0}^n{d(v_k)^2}$

### ZOJ2317 Nice Patterns Strike Back

source code (ZOJ2317.java) [DP, 矩阵乘法]

### ZOJ2318 Get Out!

source code (ZOJ2318.java) [graph, geometry]

### ZOJ2319 Beautiful People

source code (ZOJ2319.cpp) [DP, LIS]

### ZOJ2320 Cracking’ RSA

source code (ZOJ2320.java) [number theory, linear system, gauss elimination]

$b_i=\prod_{j=1}^t{p_j^{a_ij}}$

$\left\{\begin{array}{l}a_{11}\land x_1\oplus a_{12}\land x_2\oplus \cdots\oplus a_{1m}\land x_m=false\\a_{21}\land x_1\oplus a_{22}\land x_2\oplus \cdots\oplus a_{2m}\land x_m=false\\\cdots\\a_{t1}\land x_1\oplus a_{t2}\land x_2\oplus \cdots\oplus a_{tm}\land x_m=false\\\end{array}\right.$

10 Responses to “Andrew Stankevich’s Contest #1解题报告”
1. tracyzhu says:

ZOJ的java有没有啥好的IO或者其他优化方法呢….我2313和2317在ZOJ都超时了，SGU上都没问题…

• watashi says:

sgu单case时间也许更宽松一些吧，你是用Scanner么，这个很慢的
在TC/CF上可以看到，像Egor, wata这样专用java的，都有自己的读入库吧
不过有些题实现比较紧，java是基本没法过的

• tracyzhu says:

…确实是Scanner….我去改其他的试试~~

2. zjut020 says:

不是，是c++
哦，那我优化下··

• zjut020 says:

囧了，你的也超时……

• watashi says:

Run ID Submit Time Judge Status Problem ID Language Run Time(ms) Run Memory(KB) User Name
2164885 2010-04-16 13:22:38 Accepted 2317 Java 2630 2735 watashi@Zodiac
2164883 2010-04-16 13:22:28 Accepted 2317 Java 2590 1501 watashi@Zodiac

我刚才又交了两次……我也不清楚怎么回事了

3. zjut020 says:

问下ZOJ2317 Nice Patterns Strike Back
这题的zoj数据是不是有问题啊，我在sgu ac了这里却超时了。。
= =

• watashi says:

不确定，但我觉得应该没什么大问题，我两边都可以，不过sgu是一个一个case跑的，ZOJ时间可能更紧
我只知道sgu有几道题的spj有问题，WA的也能AC
你是用java吗？

4. VegetableB says:

这套题比较老了，几乎都成了经典题了……

• watashi says:

= =b ym 不读经典的飘过
大妈里很多模型都可以成为经典

5.