Welcome again!

I decided to split statistics for both division. Post for first division ~~will be added later~~ is here.

So, let's look at hacks in Codeforces Round #263 (Div. 2).

~~Some statistics are missing — I have some problems with downloading all data (Codeforces seems little crowded today). They will be also added later.~~

**Update**: Europe went asleep, so I added missing stats.

### Stats

Problem | Successful hacks | Unsuccessful hacks | Other | Sum |
---|---|---|---|---|

462A - Appleman and Easy Task | 5 (17%) | 25 (83%) | 0 (0%) | 30 |

462B - Appleman and Card Game | 1193 (71%) | 188 (11%) | 306 (18%) | 1687 |

462C - Appleman and Toastman | 0 (0%) | 55 (36%) | 98 (64%) | 153 |

### Fastest hackers

Problem | Time | Hacker | Defender | Hack |
---|---|---|---|---|

462A - Appleman and Easy Task | 00:50:08 | ak.bewildered | A__H | 110493 |

462B - Appleman and Card Game | 00:20:49 | Jack_whj | ayushrocker92 | 110023 |

### Remarks

#### 462A - Appleman and Easy Task

The problem was pretty simple, but still there were some mistakes (there were only 4 successful hacks and over 150 solutions which passed pretests, but didn't pass all tests).

The "killer" tests:

- Test #32, used also in hack #111676 by xiaxiaosheng.

```
2
oo
xx
```

Some solutions just count the overall number of all neighbouring o's and check if this number is divisible by 2.

- Test #16 or for example hack #111424 by anikaitshivam.

This test was just checking maximum value of *n*, which was 100. Depends on mistake, solutions got *Runtime error* or *Wrong answer* (because of checking values for *i* = 101 and so on).

- Test #11 or hack #111740 by the_redback.

The main problem for these solutions was using *break* command in double *for*. What it did is just break from the inner *for*, staying in the outer one, which sometimes finished with *Wrong answer*.

Pretty interesting mistake failing on this case was this one (the code is in C++):

```
if (a[i][j] = 'o')
```

Somehow, this solution passed first 10 tests. The problem is that the condition in *if* in such case is always fulfilled. Why? It is assignment operator, so from this time *a*[*i*][*j*] was equal to 'o', and it was always true. The problem is that *a*[*i*][*j*] might be changed (and we didn't want it).

#### 462B - Appleman and Card Game

At first, I was pretty afraid looking at this task (1193 successful hacks!). But the problems were pretty simple. I should say problem, because it was one: **long long**s!

We just need to notice that result could be even *n*^{2}, which was about 10^{10}.

Another problem with pretty big numbers is shown below (code written in C++):

```
long long ans = 0;
int n = 100000;
ans += n*n;
cout << ans;
```

The result will be `1410065408`

. Why? The problem is when we are multiplying two ints, the result wants to be int, but it is bigger than 2^{32}, so it distorts.

The proper way to solve this problem:

```
ans += 1LL*n*n;
```

Now the program knows that the product should be long long and the result is correct (`10000000000`

).

#### 462C - Appleman and Toastman

We would just look at test #19, which was pretty simple:

```
2
1 2
```

Most of the hacks (if not all) in div. 1 were based on such testcase. Many people had *if* in case *n* = 2 and printed the sum *a*[0] + *a*[1], but we can split this set into two subsets (*a*[0]) and (*a*[1]), then give it back to Toastmen and get in the end 2(*a*[0] + *a*[1]).

#### 462D - Appleman and Tree

There was no hacks for this problem, but there was one mistake. The problem is with proper using of modulo. In such case:

```
x = a%MOD + b%MOD
```

sometimes x can be grater than MOD (for example for a=6, b=7 and MOD=4), so we should use:

```
x = (a%MOD + b%MOD)%MOD
```

#### 462E - Appleman and a Sheet of Paper

Again, there was not a single hack, but still there were some solutions which passed pretests, but didn't pass test #13. Unfortunately, we cannot look at it, because it is too big.

Most of these solutions were just brute-force approach. Pretests weren't too hard to pass.

### Best hackers

### Best rooms

Room | #hacks | Hackers | |
---|---|---|---|

63 | 21 | IMAN_GH [13], bolyeria [6], xiaxiaosheng [1], TimeMachine [1] | |

66 | 20 | nenu_x1p [17], rishi_saraswat [2], shobhit6993 [1] | |

98 | 19 | SameerGulati [15], hamedArafa [3], Kouichi [1] | |

97 | 19 | mosiomohsen [19] | |

46 | 19 | hetanglianyi [19] | |

23 | 19 | loujunjie [10], vijayarsenal10 [5], cainiao_tooweak [2], the_redback [1], jokkebk [1] | |

93 | 17 | I_Love_Balabala [9], VeniVidiVici [7], ultimatemaster [1] | |

84 | 17 | hball1st [11], purple_jwl [6] | |

80 | 17 | NiceDay [10], korun [6], nxphuc [1] | |

38 | 17 | lamnguyen.rs [12], 53645 [4], jnalanko [1] | |

28 | 17 | DemoVersion [11], tap628LJ [6] | |

90 | 16 | stupida [13], round_0 [3] | |

33 | 16 | chinesejiang [13], osama [3] | |

29 | 16 | cup_of_tea [13], Morgan_HackProg [2], ho-jo-bo-ro-lo [1] |

### Countries

Country | #hacks / #hackers | Hackers (with at least one successful hack) |
---|---|---|

France | 13.00 | cup_of_tea [13] |

Brazil | 13.00 | dcms2 [13] |

Bolivia | 11.00 | DrPaulVazo [11] |

Iran | 8.43 | mosiomohsen [19], IMAN_GH [13], DemoVersion [11], pawky [9], ehsanoo [5], argooogooly [2] |

Macedonia | 8.00 | add1ctus [8] |

Mongolia | 7.50 | Enkhsanaa [11], Nuadra [4] |

### Biggest gap

Hack | Hacker | Defender |
---|---|---|

110746 | worse [153] | BlakeGriffin [1596] |

110731 | worse [153] | cosmin [1453] |

110997 | worse [153] | ZOTAC89 [1399] |

110670 | worse [153] | dozycat [1357] |

111249 | worse [153] | mag20174301 [1313] |

110640 | worse [153] | karthikkamal [1232] |

110702 | worse [153] | VKundas [1159] |

110680 | worse [153] | HujanLebat [1058] |

110945 | Zoli [1134] | fro11o [1598] |

111341 | nguyenchicuong [1202] | YannLuo [1609] |

worse is attacking with 9 hacks (and 77 unsuccessful ones).

### Charts

#### Successful hacks over time

Pretty boring this time.

Thanks and again: sorry for all my mistakes, feel free to correct me. Previous post can be found here.

I have some other ideas about such stats and reports, so I will try to work on them — look forward to see them in nearby future!

Always wanted to see this kind of analysis, very interesting to know what can be the principals wrong algorithms or bugs. Thanks a lot, I hope we'll see similar analysis with next contests.

Thanks to these I'm now in div 1 :D

You are soooo good at this, DO THIS FOR EVERY CONTEST! :D

I'm sure that after several of this post in the future, simple mistakes like integer overflow in Div.2 will reduce

A LOT:DAnd we will see how worse can push his rating down to ........ negative!?

EDIT: worse has achieved negative rating! May I say "congratulations" to him? :Dyes, worse has indeed achieved negative rating! :D

Good job! I have learned a lot from this analysis. And I will care more details when I am programing!

Do this for every contest, I wish your contribution would be higher than DmitriyH