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

Автор Betlista, 9 лет назад, По-английски

In SRM there were 1303 registered participants

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

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

Автор Betlista, 9 лет назад, По-английски

In SRM there were 1413 registered participants

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

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

Автор Betlista, 9 лет назад, По-английски

In SRM there were 849 registered participants

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

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

Автор Betlista, 9 лет назад, По-английски

I strongly believe, that editorial delivery for SRM is (should be) part of the contest.

The fact, that TopCoder editorials are delayed (currently unavailable ) is really bad I think. So there are two possibilities — to do not care or do something with that. I selected the later.

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

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

Автор Betlista, 9 лет назад, По-английски

I did the same mistake in a second contest (at least), so I have to write this down...

When I have sorted array, I'm using binary search to find number of elements lower than some boundary value d. Problem is, that in Java, call Arrays.binarySearch(array, d) returns so called insertion point and it is valid to return for array let say 10, 20, 20, 20, 30 value 2 (0-based index, tried with Java 7) as the insertion point for searched value 20, but it doesn't mean that there are 2 elements lower than 20 in array...

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

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

Автор Betlista, 9 лет назад, По-английски

I failed in contest #280 because of int overflow.

I knew I have to handle that, but I missed it :-( So I was looking for some automatic check.

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

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

Автор Betlista, 9 лет назад, По-английски

This is just a note for me, to not "invent" it in next contests, maybe too easy for others.

I have two intervals [f1, t1] and [f2, t2] and I want to find intersection.

private static int[] intersect(int f1, int t1, int f2, int t2) {
    if ( isBetween(f1, f2, t2) ) {
        return new int[] { f1, Math.min(t1, t2) };
    } else if ( isBetween(f2, f1, t1) ) {
        return new int[] { f2, Math.min(t1, t2) };
    } else {
        return null;
    }
}

private static boolean isBetween(int n, int f, int t) {
    return f <= n && n <= t;
}

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

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

Автор Betlista, 12 лет назад, По-английски

Hello coders,

probably some of you know CodeChef (another programming contest page).

Why am I writing about another page? Because I believe, that when you want to make your rating higher, you have to compete in contests. Some coders think, that practice and contest are the same (just solving the problems), but definitely they are not for me. In contest I'm under the pressure (time pressure, fear, that if I do not solve the problem my rating will be lower, ...) and so I'm doing a lot of mistakes in real contest (like not reading statement carefully, missing some conditions, trying to submit quickly without precise testing and so on).

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

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

Автор Betlista, 12 лет назад, По-английски

Hi coders,

I was looking for code highlighting functionality on CodeChef forum. Now when new editorials will be moved from wiki to forum, this request is more important as I am convinced that code highlighting improves readability of the code (it's also one thing that's missing on CodeForces when you want to hack someones solution in contest — code is not highlithed), I wrote new extension to enable such functionality.

First version just lets you choose the language (I want to improve this in next version).

What you get?

C/C++ before

C/C++ highlighted

Java before

Java before

Java highlighted

Java highlighted

Download and install

To install the extension you have to:

1.) download it here

2.) unzip somewhere

3.) go to the Tools > Extensions in chrome settings

4.) than you need to enable developer mode and upload unpacked extension (from the location where you unpacked it)

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

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

Автор Betlista, 12 лет назад, По-английски

Coders always argue which programming language is better. Each one of you have some preference. I like Java the most. But there is at least one thing missing in Java for sure — permutations.

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

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

Автор Betlista, 12 лет назад, По-английски

Counting map is special map used for counting things — values in map are integers.

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

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

Автор Betlista, 12 лет назад, По-английски

Hello coders,

next TC SRM 533 is scheduled on 02.18.2012 12:00 PM EST.

It's brought by Google.

Registration starts 3 hours before start and ends 5 minutes before start (be aware that even if coding phase starts at 12:05, registration ends at 11:55).

Also there is limit for number of participants (something like 2300 or so), but typically there is not so many coders (just in time of TCO, number of participants in SRMs increases over the limit).

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

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

Автор Betlista, 12 лет назад, По-английски

This is first blog in my new series "How I spoiled the contest".

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

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

Автор Betlista, 12 лет назад, По-английски

Hello coders,

I misundestood something in problem 69B and I do not know what. Some advice would be great.

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

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

Автор Betlista, 12 лет назад, По-английски

Probably almost everyone here knows the contest, but I didn't find post about it here (except this one)...

Currently there is qualification round for GCJ 2012 running just now, enjoy ;-)

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

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

Автор Betlista, 12 лет назад, По-английски

It is easy to find if some number (say N) is prime or not — you simply need to check if at least one number from numbers lower or equal sqrt(n) is divisor of N.

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

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