Skip to main content

Morocco...Day 4... The Big Day

Alsalam alikom wa ra7mat Allah wa barkatoh

It's now Saturday, 7:00am. We waked up fully enthusithied... all wore our T-Shirts, I had problems in choosing what to wear under the T-Shirt cuz they restricted that everybody should show up in T-Shirts.. At last I wore a Black T-Shirt (edooh long) that is originally my sleep-clothes.... I didn't like how I looks but it's ok... I don't care much... the most important thing is to appear in T-Shirts and not to catch cold....

Everybody else did nearly the same.. we were ready to go and BEAT THEM ALL ;) ...

Few minutes later, they came to pick us, we arrived on time.. actually before the time :D, the Contest was supposed to start at 10:00am, we were there at about 9:20am, the runners guided us to some green flat place, where every group made a circle and they started to have pics, chats with others and such...

Time passes, and it seems they will not start the contest on time... we started to go to each group and pic a photo for them.. after that they ( the organizers ) felt it's too COLD to leave us out there, so they suggested that we can go to Building 4 where it's warm enough to live :D... we all went there but we stayed outside of building 4 (as most of people did)... we had a tour in the place (cuz it's really fantastic and u will c that in pics..) we had some pics in different places.
then came back to building 4 where Abdalla was standing with Arab Academy Guys...
Later ( we started to lose hope that we will start the contest today :D ) we noticed that SidiAli is walking carrying a lot of papers... we shouted "hey, WOOOOOOOOOOOOO" so he noticed that everybody is looking at him and started to run :D.... we were just kidding anyway...

Later, someone from Jordan came and asked us, "Do u have a way to know the time limit that the judge has for certain problem ?", we all didn't have any way cuz simply we didn't think about that before... but later, we sat together and though... why not :D ?, then we opened a laptop and made a contest on PC^2 and defined some time limit, then on the client we pressed the Test Button and it worked.... the timer that shows up when u hit test is the same that the Judge sees.. it turns Red when u pass the time limit... IT'S GR8 :D.... we told the guy who asked us of course.

It's now sometime later... I don't remember when exactly. They called us to prepare to enter to the contest Room... I didn't like the way... we were standing infront of some door -not organized- then they started calling team names, and we standed in line... every team passes the door is given a paper that has 2 importan info : the Team ID (which is where to sit) and a Password which is the solution they found for the Printing trick :D, if u want to print something, u have to put this password in the begining of the page...

so.. they called our name.. we passed, Amigos was next, and Dr.Darhmaui liked their team name a lot... we went up.. entered the room and found that our table was infront of the door having they Egyptian Flag on it.. and a long thin wood thing attached to the table.. the table had our bag of books on it, 3 pencils, 3 water bottles, and the Magic Envelope... that contains the PROBLEMS...

10, 9, 8, 7, 6, 5, 4, 3, 2, 1... staaaaaaaaaaaaaaart... I was sitting in the middle, AbdelRahman to the left, Mustafa to the right.. we distributed the problems, Mustafa A, I took B, AbdelRahman C, Mustafa D... etc... we started reading... reading, then suddenly Mustafa said, I got a solution for this, take it and code it.... I looked in his eyes, he was shaking... his hand that was holding the problemSet was SHAKING... I said to him "fee eih ya mustafa, ehda.. 3adee..." he didn't respond, he said "I'll tell u the solution and u code it...".. I accepted (and this was wrongggg..) he told me, I coded it and sent we got something that is not AC :D... then, Abdel Rahman did the same as what Mustafa did.. he gave me another problem and asked me to code it... again not AC...

Let me tell u why I said "wronggg", first as Abdalla always tells us, nobody should write code to a problem that he didn't read... if u will code, then read the problem (even if somebody else has read it and gave u a written solution)
Second, it's wrong cuz at the end of the contest, I have written 5 problems or something like this... and I was just Exhusted... that I wasn't able to complete the last problem..

Let's come back to the contest..

After 16 wrong submissions in 3 hours.. the first place team had solved 3 problems already.
We got our first yes.. I guess it was AbdelRahman's problem after that I coded a 2-line problem that was originally Mustafa's but when he first had a look on it, he found it looks like a Maze so he thought it maybe difficult enough, when I read it deeply, it can be solved in 2 lines exactly... so I coded it and sent, and got our second AC...

Later, we got our third and fourth problems just before the last hour starts..
We are now rated the 12th, Abdalla was just "boiling" in the Coaches Room :D. By now the, the first team had 7 problems solved...

We had no other choice to get a good rank (maybe if we r lucky enough, we can get the first) so we started to debug in 2 problems on the pc (one for Abdel Rahman and one for Mustafa) and mustafa started solving another problem on paper, and I had wrote a problem on paper already... so I helped Abdel Rahman debugging the problems and we got them both Accepted al 7amd lellah.. then I started writing my problem while Mustafa didn't finish his one yet. Now I began to feel exhusted as I told u... I was not able to concenterate well.. I could hardly finish typing it...

While typing I heared AUC guys saying mm I don't remember but they were happy cuz they solved their 7th problem...
Few minutes later the whole room heared "YESSSSSSS" from the Arab Academy guys cuz they solved their 8th problem.... mm that time I realised it's 0% probability to be the first nor the second... but we can be the third... let's go on....

Then I faced a LOT of compilation errors... I started repairing them... Done... I told them, I will try it once, if it worked, it's ok.. if not, I'll let Mustafa write his problem, it's now 20minutes prior to the end of the contest, when mustafa started typing his problem... he finished then Run.. Crash.. Run .. Crash.. oh.. I forgot to write function X...
10, 9, 8, 7, 6, 5, 4, 3, 2, 1.... the contest is FINISHED..

I was not satisified with the results.. cuz I felt we could have at least another problem done..
Al 7amd lellah Al 7amd lellah Al 7amd lellah, just before we start collecting our things, we found Abdalla rushing to the room asking "ha, what did u do ?" he was somehow satisified when he knew we got 6 problems done... he told us about Amigos and that they didn't manage to solve except 5 problems... we spoke a little with FCI-CairoUniversity guys cuz they were so angry about some problem's input... it was not clear and the input had some wrong cases :D we got this problem AC cuz we wrote it mmm let's say generic enough to bypass wrong cases..

Then we congratulated AUC and Arab Academy... few minutes later, we found some TV Channel making an interview with a girl from Kuwait University I guess... we didn't care much :D we wanted to go down for Amigos...

While going down, I asked Abdalla where is my things (which are Laptop, Mobile, MP3 Player, Camera too much to lose :D ) he said "oh my god.. I forgot them :D, wait a minute I'll try to find them.." then he went down to the Coached Room where they were sitting, and lucky I was, he found my bad beside some chair.. we then went to Amigos, they were not happy at all... but Satisified Al 7amd lellah.. we all went down to find what is called Lunch about to finish :D ... I took a Sandwish and then a guy came and informed us the buses will be ready to pick us after about 00:45 minutes... so we should eat, go to the hotel, change our clothes and be ready before thsoe 45 minutes :D... I just left holding this sandwish with me :D....

I wrote a lot today.. I guess there r still some notes I forgot to add.. I will be editing this post as long as I remember...

In Shaa Allah, Next post will be Day4 too :D cuz it'll be about the Closing Cermony and the trip back to Cairo...

Alsalam alikom wa ra7mat Allah wa barkatoh

Comments

  1. al salamo 3alikom wa ra7mato Allah,

    since i knew the secret path to ur blog :D, i started tracking ur posts (7'od balak t2ool 7aga we7sha kda walla kda ;1;2 )

    u remind me with the contest, which is not good :D
    but what is good is that u got the 5th rank, that's really good improvement .. 4 places in one year, heuristically..next year u gonna be the first n-sha2-Allah :D
    da depends 3ala e7na hankoon fein ;)
    u've done gr8 work shabab, and u didn't forget anything in ur post :D, just about the TLE trick..the guy from Jordan asked if it turns red or not, not how to discover TLE,, which differs, as i remember :D

    yalla salaaam

    ReplyDelete
  2. Salamo Alikom,
    a7'eeran the post i waited for. mafeesh 7aga mo3ayana ha-comment 3leeha, but nice memories :D.

    I didn't notice that TLE issue before, but plz remind me to see it in the coming contest isAllah. which by the way will be when :D ??!!

    ReplyDelete
  3. Alsalam alikom wa ra7mat Allah wa barakatoh,

    Zezo: Congratulations for finding that secret path, I thought once to put a prize for finding "where haytham speaks online" :D but who cares ?!! besides, any 10-year old child will write my name in google and this blog will show up...
    Sometimes I hate that google works fine :D

    U improved too, even this didn't appear in the results... In Shaa Allah next year FCIS on the top...

    Thanks for correcting me.. Hope ur memory works fine :D.

    for Asmaa :
    Once I read a nickname that says "Memories are so nice, but that's all what they are"...
    I guess if we stopped to that extent, memories would be useless, we should try to learn from them...

    About the contest .... this is a good question actually.. All what I can say is "be ready for a contest at anytime next Semester In Shaa Allah"

    Alsalam alikom wa ra7mat Allah wa barakatoh

    ReplyDelete
  4. I've just read the contests problems.

    A] Being Smarty!:
    It's biggest problem is in getting the input. Using getline b2a we han2atta3 el string.
    once u have R, N, P1, P2, u can do this:
    R--;
    temp = R/N;
    temp = temp%2;
    if(temp == 0) -> P1, else P2;

    [B] The Game of Tetris:
    I don't have the algorithm in my mind now, but I think u'll have to find the maximum number that can be calculated from 4 cells, then check if these 4 cells is a valid shape or not. if not try the second maximum number. Don't tell me how :D

    [C] Wooden Blocks:
    2 dimentional array that u can initialize manually to keep the valid choices of the next pieces to this piece. check if piece 1 is not the start or piece 2 is not the end. for loop and check if the next piece is not in the array of the current piece.

    [D] Walk Like an Egyptian:
    This is really a nice one and can be done in 2 lines :D. u have n, calculate x = n^2 and y = (n-1)^2 + 1. get the diffrence diff. add diff/2 to y or subtract diff/2 from x :D.

    [E] The Great Sahara:
    Needs some thinking of a general rule to get the 3 possible cells that the player can move to. I'll search for it in the grids chapter in PC.
    //if u have that rule, plz tell me.
    Then a for loop and try 3 possible moves to see if it blocks the other player.

    [F] Johnny Hates Number Theory:
    I remember that Roaa showed me an algorithm that can do this in O(n). But before implementing this algorithm u need to know the p(n) of each of them which takes time. U can keep the previously calculated values in an array, but does this really avoid the TLE ??!!

    [G] Minimum Spanning Tree:
    Actually, I didn't even read the problem. I haven't read MST algorithms yet.

    [H] A-to-Z:
    It's mmmmmm, How did u solve it in a time limit??!!

    [I] Casting Out Nines:
    The problem statement gave u the algorithm to follow :D.

    lw kont da7'alt el contest b2a, kont ha7ell kam problem :D ??!!

    Waiting for ur reply :D.

    ReplyDelete
  5. Alsalam alikom wa ra7mat Allah wa barakatoh

    Actualy it's not so "nice" that u read the problemset :D... don't ask me why... U will know soon.. maybe.

    el mohem
    [A] Right
    [B] Right... just think a little bit more
    [C] Right
    [D] Looks Right, Although we got a shorter equation :D
    [E] We didn't follow a "Rule"... why to think while the PC can do it anyway ;) ?
    [F] Yes, that's it..
    [G] Ok, read it, it's so essential.
    [H] Instead of all those "??!!", tell me ur algo :D.
    [I] Right

    Let me tell u something, the main problem with all Regionals (till this one) was in the Tricky TestCases... it's not that their ideas r hard, it's not that their algorithms are hard to implenet.. it's just the Judge's Data..

    So basiclly, I say, ur solutions are good enough but how about ur implementation ?

    Sheddee 7elek ya Asmaa.. begad :). Your team deserves the best, don't lose the chance, it doesn't come twice anyway..

    Alsalam alikom wa ra7mat Allah wa barakatoh.

    ReplyDelete
  6. I know that the problem is in the tricky test cases. I figured this out since the problems are somehow easy, so they must be tricky.
    I wanted to solve some of them but I couldn't find them on OJ nor Live Archive. I'll code them anyway isAllah.

    I still don't kow why it's "not nice" to read the problemset :D

    ReplyDelete

Post a Comment

Popular posts from this blog

Exploiting Double Free Vulnerabilities...

Alsalam alikom wa ra7mat Allah wa barakatoh



Huh!! that's what I said when I first saw that title... but let me explain...


Double Free means that you try to free a pointer two times (which is logically can't work).
Actually windows SP2 and later (even Vista) this can be done (in somehow) and can actually corrupt the heap (Vista will shout at your face if u did) and that can make you able to use and browse the heap as you want..

Facts to know about how Windows frees your pointers:
- There is something called Lookaside buffer (fast access, small size) and another thing is FreeList(slower access, the whole memory).
- Chunk is an object of the DataStructure that holds mainly 2 things: pointer to where the next free Chunk is and pointer to the previous free one (think about it like a node in a linked list)
- The first 4 bytes of the Chunk is the BLink (BackLink) and the second 4 bytes is the FLink
- delete ptr1;
delete ptr2;
Windows takes your Chunk (for ptr1) and puts it in the Lookaside s…

Windows7 adds Math Input Panel

Alsalam alikom wa ra7mat Allah wa barakatoh…I was reading a windows team post about Input Panels improvements in Windows7 [here]. When at the end I saw a very interesting –intuitive if you wish- new thing… which is, as you guessed, the Math Input Panel…Yes, that crappy font is mine… I “drew” that by mouse as I don’t have a tablet pen/pc.You can then paste it directly into word and it’ll recognize it as an editable equation…During my tests, the output panel (the top part) hanged, but I liked that the drawing panel was still responsive and I could still write/erase… till the top one started to respond again…One other thing to know, after you click Insert (that button down there) it copies the equation in MathML [Wikipedia link] format.. which is a standard way of representing equations and hence any application that recognizes the format can insert it not as an image but as a nice editable equation…If you think it recognized something wrong, you can click “Select and Correct” then draw …

Visual Studio 2008 Not saving changes or project properties?

Alsalam alikom wa ra7mat Allah wa barakatoh (Peace upon you)I’ve recently ran into problems with VS 2008. Summarized here:When you try to edit the project properties (specially C++ projects) you are faced with a little nice message saying “Exception from HRESULT: 0xF9F0F308”. Sometimes when you are editing a file (specially large ones), VS doesn’t recognize you’ve made changes (ie doesn’t display that ‘*’ in the files tabs) hence, when you save, nothing actually gets saved. For those 2 problems, a friend explained the problem and a work around (till they officially release a fix)…Open up a Visual Studio 2008 Command Prompt Run cd "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE" Make a backup copy of devenv.exe in case something does not work right.
ie. copy devenv.exe devenv.exe.bak Run editbin /largeaddressaware:no devenv.exe Happy VSing… :)