jaythegenius48's blog

By jaythegenius48, 9 years ago, In English

Once while participating in the contest, I wanted to find out the room number of my colleague. So I asked him and he told me the room number.

From this, I was inspired and started thinking how can this be achieved without asking my friend.

So, I wrote a script in python, which finds the username in "xyz" room. But since the distribution and labelling of rooms is different in each contest. I was unsuccessful in achieving this. Since it requires searching in all rooms.

This could be the best place to ask this question!
Are there any patterns? Using the API can solve this?
Any suggestions are welcomed.
Sorry if I am violating the rules of codeforces. I am new to crawling of webpages.
Thanx in advance:)

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

| Write comment?
»
9 years ago, # |
Rev. 2   Vote: I like it +21 Vote: I do not like it

double clicking on string with person in standings shows room and all submits&hacks

»
9 years ago, # |
  Vote: I like it +6 Vote: I do not like it

There is a Codeforces API and there is a contest.standings method there which has a room parameter which should be helpful if you decide to do that programatically. For example:

http://codeforces.com/api/contest.standings?contestId=374&from=1&count=5000&showUnofficial=true&room=1 will bring you all the contestants from the contest with id = 374 in room 1. This seems to be the best candidate for your task.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    This was indeed helpful! But how many rooms are there im contest and which room number is the last one is recognised by?

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Hm, good question and I have no good answer for it. As far as I know you can't get that using API. It seems that room numbers are like [1 .. lastOfficialRoom] and [1000 .. lastUnofficialRoom], so you can start with 1, 2, 3, etc until you get an empty room and then do the same for the unofficial rooms.