Hello and welcome in Codeforces Round 279 (Div. 2) — description of hacks.
Previous posts can be found here.
Stats
Problem | Successful hacks | Unsuccessful hacks | Other* | Sum | Solutions which can be hacked | Accepted solutions | All solutions on final tests |
---|---|---|---|---|---|---|---|
490A - Team Olympiad | 13 (27.66%) | 22 (46.81%) | 12 (25.53%) | 47 | 80 (3.55%) | 2174 (96.45%) | 2254 |
490B - Queue | 9 (15.79%) | 21 (36.84%) | 27 (47.37%) | 57 | 268 (20.12%) | 1064 (79.88%) | 1332 |
490C - Hacking Cypher | 218 (52.40%) | 102 (24.52%) | 96 (23.08%) | 416 | 376 (42.11%) | 517 (57.89%) | 893 |
490D - Chocolate | 15 (60.00%) | 9 (36.00%) | 1 (4.00%) | 25 | 172 (39.27%) | 266 (60.73%) | 438 |
490E - Restoring Increasing Sequence | 0 (0.00%) | 1 (100.00%) | 0 (0.00%) | 1 | 68 (33.33%) | 136 (66.67%) | 204 |
490F - Treeland Tour | 5 (71.43%) | 2 (28.57%) | 0 (0.00%) | 7 | 30 (40.54%) | 44 (59.46%) | 74 |
* one of the: INVALID_INPUT, GENERATOR_INCOMPILABLE, GENERATOR_CRASHED, IGNORED, OTHER
Hacks and possible hacks description
490A - Team Olympiad
The most common errors were:
using too small array (or other container), which can result in runtime error
wrong usage of
min
function: for example in C++ such code will compile:
int x = 2, y = 3, z = 4;
cout << min((x,y),z);
and the result would be 3. Why? The min
function take two integers — the second one would be z, the first one would be naturally (x, y). What would be result of such thing? Using comma will result in taking the result of the last argument.
More specifically (by Wikipedia): "Comma is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type)."
For another example:
int x = (abs(-4), abs(-3));
cout << x;
returns 3
. It won't work without this brackets (think why).
How to correct such thing? It's pretty simple:
min(x,min(y,z))
490B - Queue
In this problem, there weren't many hacks, most common mistake was simply using too small table.
490C - Hacking Cypher
At first, there were no pretests with large n, so big tests with for example answer -1
can grant some points.
Second, the time limit was quite strict for some languages — for example, there were only 1 accept in Python!
Third, some people used strlen
function in C++, which has O(n) complexity, so if you use it n times you gain O(n2) solution. Good option is to change it to the string and use method size()
instead.
490D - Chocolate
You may get tle or mle, when you use recursion without memoization. Pretty nice test was:
967458816 967458816
967458816 967458816
967458816 = 214·310
490E - Restoring Increasing Sequence
490F - Treeland Tour
Fastest hackers
Congratulations for ShawnDong and dreamoon_love_AA for being first in two different problems!
Problem | Time | Hacker | Defender | Hack |
---|---|---|---|---|
490A - Team Olympiad | 0:17:55 | choosemyname | I_Love_Balabala | 125728 |
490B - Queue | 1:16:02 | ShawnDong | bullshit.ass | 125766 |
490C - Hacking Cypher | 0:29:02 | ShawnDong | heat_wave | 125732 |
490D - Chocolate | 1:26:39 | dreamoon_love_AA | sd0061 | 125784 |
490F - Treeland Tour | 2:05:20 | dreamoon_love_AA | pulkitg10 | 126028 |
Best hackers
Best rooms
Room | #hacks | Hackers |
---|---|---|
74 | 15 | IAm10110o1011 [15] |
37 | 11 | Yura_Sultonov [11] |
11 | 10 | monkey_king [8], Risers [2] |
1005 | 10 | anta [9], Amir.bh [1] |
73 | 9 | hq9907 [9] |
1000 | 9 | uwi [5], Kaban-5 [2], xxTastyHypeBeast666xx [2] |
1011 | 9 | dreamoon_love_AA [7], Programist [2] |
77 | 8 | Branimir [4], abhra73 [4] |
17 | 7 | choosemyname [6], I_Love_Balabala [1] |
42 | 7 | rtriangle [7] |
66 | 7 | Anuar [5], alex_bucevschi [2] |
75 | 7 | Horea [4], Tima [3] |
Best countries
Country | #hacks | Hackers |
---|---|---|
Japan | 26 | anta [9], uwi [5], atetubou [4], deflat [4], kmjp [2], sugim48 [2] |
Russia | 26 | rtriangle [7], GoDDoS [6], arturom [5], HellKitsune [3], solonkovda [3], SpyCheese [1], Flyrise [1] |
India | 24 | Dr.I_m_possible [5], b4world [4], abhra73 [4], ddt [3], PrashantM [3], achaitanyasai [3], grayhathacker [1], vignesh_m [1] |
Uzbekistan | 23 | Yura_Sultonov [11], monkey_king [8], D05T0N [3], Ozodov__Jamshidbek [1] |
Kazakhstan | 13 | Anuar [5], Tima [3], SmallBoy [3], amiro [1], amanchik [1] |
China | 11 | hq9907 [9], I_Love_Balabala [1], q444372930 [1] |
Egypt | 11 | 7asn_a7md [4], ahmedameen [3], Killever [1], Omar [1], Druid [1], mahmoud_arafa [1] |
Thanks for making this analysis!