Блог пользователя dzhi

Автор dzhi, история, 17 месяцев назад, По-английски

It appears that Codeforces' judgement system uses a rather huge stack size (maybe 256 MB or even more). A typical example is a DFS solution on a large tree with 200000 nodes, potentially a stick/chain of 200k nodes so the call stack has 200k frames!

Such a huge stack size, likely was introduced to allow DFS or other recursive solutions, which is considered as a bad practice and usually discouraged in production software system:

  • Software systems are usually multi-threaded (dozens or even hundreds of threads) to leverage all the CPU cores and be flexible to network/disk IO delays. Individual threads can not have a huge stack size due to memory limits.
  • With a huge stack size, most of the memory reserved for the stack is likely wasted most times.
  • More importantly, recursive code has the risk of hitting stack overflow at runtime at unpredictable and inconvenient times (like a mine in the field). It is usually discouraged or even forbidden to implement recursive code with unbounded or huge layers.

I wonder what other people's opinion about this, and/or a good reason Codeforces uses a huge stack size.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -14
  • Проголосовать: не нравится

Автор dzhi, история, 19 месяцев назад, По-английски

I recall there was a thread about Google Code Jam Farewell Rounds a few days ago. Now that I barely finished most of the problems, I wonder how to find the thread as it was no longer in the "Recent actions" list?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор dzhi, история, 2 года назад, По-английски

Round 137 problem G (https://codeforces.me/contest/1743/problem/G) Java submission always fails with following error: Error occurred during initialization of VM Initial heap size set to a larger value than the maximum heap size

The problem has an usual memory limit per test of 4 megabytes. The error is likely due to value of -Xmx is smaller than -Xms in the test launch. -Xms: This specifies initial heap size for JVM -Xmx: This specifies maximum heap memory size for JVM

Полный текст и комментарии »

  • Проголосовать: нравится
  • +23
  • Проголосовать: не нравится

Автор dzhi, история, 2 года назад, По-английски

I registered round #822 yesterday but didn't notice that it starts 2.5 hours before the usual time. Wonder what will be the impact to ranking, and why the unusual start time.

Suggestion to codeforces is to highlight contest with unusual start time to make it more obvious and harder to miss.

Updated: If I have a wish for the CONTESTS page, is to highlight the start time of the upcoming periodical contest that does not start at the usual 07:35.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -27
  • Проголосовать: не нравится