Betlista's blog

By Betlista, 10 years ago, In English

In SRM there were 1303 registered participants

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Betlista, 10 years ago, In English

In SRM there were 1413 registered participants

Full text and comments »

  • Vote: I like it
  • +30
  • Vote: I do not like it

By Betlista, 10 years ago, In English

In SRM there were 849 registered participants

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it

By Betlista, 10 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +31
  • Vote: I do not like it

By Betlista, 10 years ago, In English

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...

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Betlista, 10 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it

By Betlista, 10 years ago, In English

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;
}

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By Betlista, 12 years ago, In English

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).

Full text and comments »

  • Vote: I like it
  • +51
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +20
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • +20
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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).

Full text and comments »

  • Vote: I like it
  • +29
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Betlista, 13 years ago, In English

Hello coders,

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

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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 ;-)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Betlista, 13 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it