Im_too_old_for_this_shit's blog

By Im_too_old_for_this_shit, history, 9 years ago, In English

I wonder whether there are good ways to become a bugless coder. Do I need to build some style. I am mostly interested if the top teams of ICPC train their coding by some specific ways (except participating in contests). Good books (or links) teaching the principles of good coding are welcome.

Full text and comments »

By Im_too_old_for_this_shit, 10 years ago, In English

How to solve this task from Ural ? According to this it is somewhat standard. Thanks !

Full text and comments »

By Im_too_old_for_this_shit, 10 years ago, In English

How to see the content of dynamic array of objects in Microsoft Visual Studio (2010) on the debug watch window. For example.

Full text and comments »

By Im_too_old_for_this_shit, 10 years ago, In English

Given a Planar straight-line graph not necessary connected. How to find the DCEL of this planar subdivision (in other words how to find all faces) ? Generally I am interested in the case when faces may contain holes (inner components).

Full text and comments »

By Im_too_old_for_this_shit, 10 years ago, In English

Given a convex polygon. How to find ( fast ) a point for which the maximum distance from vertices is the smallest. Here is told a way, but I can't prove it and it seems to be incorrect.

Full text and comments »

By Im_too_old_for_this_shit, 11 years ago, In English

Today I have read this algorithm (in English ) , but before reading I was thinking about the problem and came to this solution. Let's sort the JOBS by the same way as it is described in the article ( i.e. by increasing order of completion) and start from the smallest. Let's keep a set of pairs (duration, index) and keep a variable 'T' which shows the sum of all the job's durations inserted in set. And if we can add our current job to set and after that 'T' will not became larger than current job's completion then insert it. Otherwise if there exist a job (in set) whose duration is greater then current duration than erase this one and insert current one. I have written this two solutions and the second one worked right for random tests. I wonder is this solution correct, and is it quite popular ( because I haven't seen it earlier ) ? And can you show problems solvable by this algorithm.

You can look at my code to understand better.

Thanks in advance !

Full text and comments »

By Im_too_old_for_this_shit, 11 years ago, translation, In English

How to find negative cycle with most sum of its edge weights (with absolute value) in a graph. In particular for the problem minimum cost flow(circulation) with solution negative cost cycle canceling Russian English. Thanks in advance.

Full text and comments »

By Im_too_old_for_this_shit, 11 years ago, In English

Can anybody show useful links for finding Eulerian cycle in directed graphs and the proof for the existence. Thanks in advance.

Full text and comments »

By Im_too_old_for_this_shit, 11 years ago, In English

TASK when I use dynamic memory program1 my submission 4209868 gets wrong answer on test 2. But on my computer it prints 00000007 00000016 00000017 00000025 But when I use vector program2 it passed the second test 4209865 I don't know why. NOTE: I decreased the size from 10000 to 1000 as vector gets Time limit. Here is the submission without changing the size 4209841

Full text and comments »